[置顶] Ext.Net 1.x_Ext.Net.GridPanel嵌套checkbox


 上图

[置顶] Ext.Net 1.x_Ext.Net.GridPanel嵌套checkbox_第1张图片

前台代码:

                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
                        </SelectionModel>
                        <Buttons>
                            <ext:Button ID="btnpathusers" runat="server" Text="批量指定用户选修"  Icon="Add">
                                <DirectEvents>
                                    <Click OnEvent="btnpathusers_Click">
                                        <EventMask ShowMask="true" />
                                    </Click>
                                </DirectEvents>
                                </ext:Button>
                         </Buttons>

注意默认:ID

        <ext:Store 
            ID="StoreUsers" 
            runat="server" >
            <Reader>
                <ext:JsonReader IDProperty="Id">
                    <Fields>
                      <ext:RecordField Name="Id" />
                      <ext:RecordField Name="name" />
                      <ext:RecordField Name="Course" />
                      <ext:RecordField Name="ScheduledDate"  Type="Date"/>
                    </Fields>
                </ext:JsonReader>
            </Reader>
    </ext:Store>


后台代码:

    protected void btnpathusers_Click(object sender, DirectEventArgs e)
    {

        StringBuilder result = new StringBuilder();
        //result.Append("<b>Selected Rows</b></br /><ul>");
        RowSelectionModel sm =this.GridPanelUser.SelectionModel.Primary as RowSelectionModel;
        Xuanke xk = new Xuanke();

        string source = string.Empty;
        foreach (SelectedRow row in sm.SelectedRows)
        {
            source += row.RecordID + ",";
        }
        if (source.Length > 0)
        {
            source += source.Substring(0, source.Length - 1) ;
            //result.Append("<li>" + source + "</li>");
            //result.Append("</ul>");
            //this.Label1.Html = result.ToString();

            xk.Source = source;
            xk.Separte = ',';
            xk.Courseid = int.Parse(this.cbxCourse.SelectedItem.Value.ToString());
            if (xk.PathAddUsers() != -1)
            {
                GridPanelWaitUserBind();
                X.Msg.Alert("提示", "批量指定学员选修此门课程成功!").Show();
              
            }
            else
            {
                X.Msg.Alert("提示", "批量指定学员选修此门课程失败请与管理员联系!").Show();
            } 
       
        }

    }

你可能感兴趣的:(String,server,object,ext,button)