checkbox模版列全选问题
chenkbox模版列中,怎么实现选中列头的checkbox后整个checkbox列全选中
急啊,高手救我
在checkbox1的checkedchanged事件中添加:
Dim i As Integer = 0
If CType(Me.GridView1.HeaderRow.FindControl("CheckBox1"), CheckBox).Checked Then
For i = 0 To Me.GridView1.Rows.Count - 1
CType(Me.GridView1.Rows(i).FindControl("CheckBox2"), CheckBox).Checked = True
Next
Else
For i = 0 To Me.GridView1.Rows.Count - 1
CType(Me.GridView1.Rows(i).FindControl("CheckBox2"), CheckBox).Checked = False
Next
End If