GridView---全选不了。。求帮助。
前台:
<PagerTemplate >
<table width="100%"><tr><td>
<asp:CheckBox ID="all" runat="server" AutoPostBack="true" oncheckedchanged="all_CheckedChanged1" />
<asp:Button ID="cancel" runat="server" Text="取消全选" />
<asp:Button ID="del" runat="server" Text="删除勾选" />
</td>
</tr></table>
</PagerTemplate>
Protected Sub all_CheckedChanged1(ByVal sender As Object, ByVal e As System.EventArgs)
If GridView1.Rows.Count <= 0 Then
Return
End If
For i As Integer = 0 To GridView1.Rows.Count - 1
Dim chk As System.Web.UI.WebControls.CheckBox = GridView1.Rows(i).FindControl("chk")
If CType(GridView1.FindControl("all"), CheckBox).Checked = True Then
chk.Checked = True
Else
chk.Checked = False
End If
Next
End Sub
dim i AS GridView1.Rows.Count
if CHK_1.Checked = true then
For I = 0 TO T-1
DGV1.ROWS(I).columns(“XX”).Checked = true
Next