if (e.Row.Band.Index == 0)
        {
            // 添加Checkbox
            string strlink = "";
            strlink = "";
            //strlink = "<input type='checkbox' name ='ControlGridID' onclick='javascript:ChkUser_Click(this);'>";
            strlink = "<input type='checkbox' name ='ControlGridID'run='server' ID='ControlGridID'>";
            e.Row.Cells[0].Text = strlink;
        }
        foreach (Infragistics.WebUI.UltraWebGrid.UltraGridRow row in this.dg_Employee.DisplayLayout.Rows)
        {
            if (((CheckBox)dg_Employee.FindControl("ControlGridID")).Checked)
            {
                this.Label1.Text = activityid + "," + "'" + row.Cells.FromKey("TEMPCode").ToString() + "'";
            }
            //this.Label1.Text=activityid;
        }

解决方案 »

  1.   

    strlink = "<input type='checkbox' name ='ControlGridID'run='server' ID='ControlGridID'>";写错了吧
     strlink = "<INPUT type='checkbox' name ='ControlGridID' runat='server' ID ='ControlGridID'>";
      

  2.   

    你这个是动态添加checkbox时然后马上又去遍历它,肯定是没值的,当你选择了checkbox后,点击某事件时,遍历代码执行了吗?????
      

  3.   

    在这个控件里的Checkbox与.net中DataGrid的用法不同:应该是
    if (dg_Employee.Rows[i].Cells.FromKey("Checkbox").Text=="true")
    {
                    this.Label1.Text = activityid + "," + "'" + row.Cells.FromKey("TEMPCode").ToString() + "'";
                }
    其中Checkbox是该列的key属性值
      

  4.   

    Infragistics.WebUI.UltraWebGrid本身就checkbox列的属性,用它的属性(Type=checkbox),我上述提到的方法就是这样的,我在多处用到,没有问题的。
      

  5.   

    用它本身的checkbox.全选时怎样取到相应行的checkbox
      

  6.   

    shengel(ede) ( ):我的qq是364171526,有什么问题可以在qq谈。
      

  7.   

    shengel(ede) ( ):我有全部选择时怎样取到相应行的checkbox的代码(用js编的,代码不长),需要我可以发给你。
      

  8.   

    slow1962(古董) .  谢谢.
      

  9.   

    shengel (ede):我已经发到你的邮箱,我用的是Infragistics.WebUI.UltraWebGrid.UltraWebGrid控件,看你的问题应该也是这个控件,.net DataGrid控件的也有,如果需要我可以再发给你。
      

  10.   

    slow1962(古董), 能不能发份给我,谢谢!!