GridView 中嵌套模版列 CheckBox 找不到 CheckBox
首先我再GridView中 手动添加了个列
BoundField te = new BoundField();
te.InsertVisible = true;
te.HeaderText = ViewState[ "grouptext "].ToString();
te.DataField = ViewState[ "groupvalue "].ToString();
te.SortExpression = ViewState[ "groupvalue "].ToString();
然后我GridView中嵌套了CheckBox.但是当我循环找CheckBox的时候找不到!
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
CheckBox cbox = (CheckBox)(GridView1.Rows[i].FindControl( "CheckBox1 "));
if (ckbCardAll.Checked == true)
{
cbox.Checked = true;
}
else
{
cbox.Checked = false;
}
}
是何问题 请高手给我解决一下
GridView 已经再if(!ispostback)
{}里面了
------解决方案--------------------别急 弄的好弄不好我都会告诉你的