Jerry Miller
asked on
Nested Gridviews header template checkbox issue
I have a nested gridview in which I am trying to get 'select all' functionality working. In the Header Template I want a checkbox that when checked will select all of the checkboxes in that grid.
Below is the code that I have in the aspx page. I added the radiobutton and the button as a test, both work as intended and select the child checkboxes by firing the systemSelectAll_CheckChang ed() event in the code behind. The chkApproveAll checkbox does not fire this event at all. I can use a button or radiobutton if necessary, but a checkbox would give more consistent look to the page.
Any ideas as to why the checkbox does not fire the event while the radiobutton and button both do? The chkApprove checkbox in the ItemTemplate above it works fine as well.
<asp:TemplateField ItemStyle-HorizontalAlign= "Center" HeaderStyle-HorizontalAlig n="Center" >
<ItemTemplate>
<asp:CheckBox ID="chkApprove" runat="server" OnCheckedChanged="systemAp prove_Chec kChanged" AutoPostBack="true" />
</ItemTemplate>
<HeaderTemplate>
<asp:Label ID="lblApprove" Text="Approve All" runat="server" /><br /><br />
<asp:RadioButton ID="rbApproveAll" runat="server" AutoPostBack="true" OnCheckedChanged="systemSe lectAll_Ch eckChanged " />
<asp:CheckBox ID="chkApproveAll" runat="server" OnCheckChanged="systemSele ctAll_Chec kChanged" TextAlign="Left" AutoPostBack="true"/>
<asp:Button ID="btnApprove" runat="server" OnClick="systemSelectAll_C heckChange d" />
</HeaderTemplate>
</asp:TemplateField>
Below is the code that I have in the aspx page. I added the radiobutton and the button as a test, both work as intended and select the child checkboxes by firing the systemSelectAll_CheckChang
Any ideas as to why the checkbox does not fire the event while the radiobutton and button both do? The chkApprove checkbox in the ItemTemplate above it works fine as well.
<asp:TemplateField ItemStyle-HorizontalAlign=
<ItemTemplate>
<asp:CheckBox ID="chkApprove" runat="server" OnCheckedChanged="systemAp
</ItemTemplate>
<HeaderTemplate>
<asp:Label ID="lblApprove" Text="Approve All" runat="server" /><br /><br />
<asp:RadioButton ID="rbApproveAll" runat="server" AutoPostBack="true" OnCheckedChanged="systemSe
<asp:CheckBox ID="chkApproveAll" runat="server" OnCheckChanged="systemSele
<asp:Button ID="btnApprove" runat="server" OnClick="systemSelectAll_C
</HeaderTemplate>
</asp:TemplateField>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER