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_CheckChanged() 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-HorizontalAlign="Center">
<asp:CheckBox ID="chkApprove" runat="server" OnCheckedChanged="systemApprove_CheckChanged" AutoPostBack="true" />
<asp:Label ID="lblApprove" Text="Approve All" runat="server" /><br /><br />
<asp:RadioButton ID="rbApproveAll" runat="server" AutoPostBack="true" OnCheckedChanged="systemSelectAll_CheckChanged" />
<asp:CheckBox ID="chkApproveAll" runat="server" OnCheckChanged="systemSelectAll_CheckChanged" TextAlign="Left" AutoPostBack="true"/>
<asp:Button ID="btnApprove" runat="server" OnClick="systemSelectAll_CheckChanged" />