Hi Guys,
following is my existing grid please help me to setup a checkbox header for the same.
<ig:WebDataGrid ID="grdItem" runat="server" Width="100%" AutoGenerateColumns="False"
EnableAjax="true" OnRowUpdating="grdPrMaintenanceItem_RowUpdating" OnInitializeRow="grdMaintenanceItem_InitializeRow" OnColumnSorted="grdPrMaintenanceItem_ColumnSorted" DataKeyFields="Id" ViewStateMode="Enabled" EnableDataViewState="True" DefaultColumnWidth="100%" ItemCssClass="thinRows"> <Columns><ig:BoundDataField DataFieldName="ItemName" Key="ItemNameKey" Width="24%"> <Header Text="Item description" /> </ig:BoundDataField><ig:BoundCheckBoxField Width="20px" DataFieldName="IsSelect" Key="isSelectKey" VisibleIndex="0" /> </Columns></ig:WebDataGrid>
Hello Vishnu,
I am still following up. Have you been able to resolve the issue?If you have any concerns or questions, please feel free to contact me, I will be glad to help you.Thank you for choosing Infragistics components!
Hi Vishnu,
This is what you need in order to have a checkbox in the header:
<ig:BoundCheckBoxField DataFieldName="OnSite" Key="OnSite"> <Header Text="On Site <input type='checkbox' onchange='headerCheckedChangedHandler(this);'"></Header></ig:BoundCheckBoxField>
And the following is the code to check the boxes in the column:
function headerCheckedChangedHandler(checkbox) { var grid = $find("WebDataGrid1"); var checkBoxState = checkbox.checked; var columnKey = checkbox.parentElement.getAttribute("key"); var rows = grid.get_rows(); // iterate through the rows and set the checkBox states and cell values for (i = 0; i < rows.get_length() ; i++) { var cell = rows.get_row(i).get_cellByColumnKey(columnKey); cell._setCheckState(checkBoxState); cell.set_value(checkBoxState); }}
Since this is using a template it can be modified in a lot of ways, but also need to be handled manually.
Hi Georgiev,
I am sorry....... that forum post is indicate. i suggest you to try that forum post.
its a basic requirement of a BoundCheckBoxField
we are using infragistics to reduce the burden of developer unfortunately its in opposite to what it means to. every day am facing new issues.
Thank you for contacting Infragistics Developer Support!
Please refer to the following forum post, I believe it will be of help.
Let me know if you need further assistance.