选择所有复选框不起作用 [英] Select All Checkbox not working
本文介绍了选择所有复选框不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI以下是我选择全部的Aspx文件复选框: -
HI Following is my Aspx file for Select all checkbox :-
<dxwgv:ASPxGridView ID="gvIndexSecurity" runat="server" AutoGenerateColumns="False"
DataSourceID="sdsUnassignedAnalyst"
KeyFieldName="PKAnalystIndustryID" OnDataBound="gvIndexSecurity_DataBound">
<SettingsPager PageSize="15" Position="TopAndBottom">
</SettingsPager>
<Columns>
<dxwgv:GridViewCommandColumn Caption="Select" ShowSelectCheckbox="true" VisibleIndex="0">
<ClearFilterButton Visible="true">
</ClearFilterButton>
<HeaderTemplate>
<asp:CheckBox ID="chkboxSelectAll" runat="server" AutoPostBack="true" OnCheckedChanged="chkAll_CheckedChanged" />
</HeaderTemplate>
</dxwgv:GridViewCommandColumn>
Aspx.CS代码
Aspx.CS code
protected void chkAll_CheckedChanged(object sender, EventArgs e)
{
//CheckBox chkAll = (CheckBox)gvIndexSecurity.FindHeaderTemplateControl(gvIndexSecurity.Columns[1], "chkAll");
CheckBox chkAll = (CheckBox)gvIndexSecurity.FindHeaderTemplateControl(gvIndexSecurity.Columns[0],"chkboxSelectAll");
if (chkAll.Checked)
{
gvIndexSecurity.Selection.SelectAll();
}
else
{
uncheckAll();
}
}
private void uncheckAll()
{
gvIndexSecurity.Selection.UnselectAll();
//chkAll.Checked = false;
}
选择全部不适合我。请帮忙。
The Select All is not working for me. Please help.
推荐答案
检查这些..
>选择/取消选择GridView内的所有复选框 [ ^ ]
在asp.net中检查标题模板时如何检查gridview中的所有复选框 [ ^ ]
http:// www。 aspdotnet-suresh.com/2011/03/how-to-selectdeselect-checkboxes-in.html [ ^ ]
Check these..
Selecting / Deselecting all the CheckBoxes Inside a GridView[^]
how to check all checkboxes in gridview when checked header template in asp.net[^]
http://www.aspdotnet-suresh.com/2011/03/how-to-selectdeselect-checkboxes-in.html[^]
这篇关于选择所有复选框不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文