Hi,
I am using Infragistic version 10.3.20103.2105. I want to add SelectAll header box in column and on select/unselect that I want to check/uncheck all the check boxes in all the rows in that column.
Can you please help me how to do this.
Thanks!
Hi guriq,
The following thread contains a sample for templating a header checkbox in the WebDataGrid:
http://blogs.infragistics.com/forums/t/60663.aspx
Please note that BoundCheckboxFields have been added as an out-of-the-box feature in versions 11.1 and later.
Let me know if you have any questions.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Please let me know if you need further assistance.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Hi Petar,
I am using Infragistic version 10.3.20103.2105. I am not able to access WebDataGrid reference with 'ig_controls' in Java Script function. Also I am not able to use '<Templates>' tag in HTML code.
Can you please share one sample with me which has been done with version 10.3.20103.2105. It will be easy for me to understand.
I am attaching a sample illustrating a 10.3 WebDataGrid with a templated field where the header checkbox checks/unchecks all cell checkboxes.
Here is the javascript code used in this scenario:
function HeaderCheckboxChanged() { //variable to hold the status of the checkBox. The tricky part is to access the input element. var checkBoxState = $find("WebDataGrid1").get_columns().get_column(1).get_headerElement().children[0].children[0].checked; //iterate through the rows and set the checkBox states and cell values for (i = 0; i < $find("WebDataGrid1").get_rows().get_length(); i++) { $find("WebDataGrid1").get_rows().get_row(i).get_cell(1).get_element().children[0].checked = checkBoxState; } }
And the corresponding grid markup:
<ig:WebDataGrid ID="WebDataGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Height="350px" Width="400px"> <Columns> <ig:BoundDataField DataFieldName="Name" Key="BoundColumn_0"> <Header Text="BoundColumn_0" /> </ig:BoundDataField> <ig:TemplateDataField Key="TemplateField_0"> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> <HeaderTemplate> <asp:CheckBox ID="CheckBox2" runat="server" onchange="HeaderCheckboxChanged();" /> </HeaderTemplate> <Header Text="TemplateField_0" /> </ig:TemplateDataField> </Columns> </ig:WebDataGrid>
Please let me know if you have any questions.
hi,
Good article...