I set the CheckBoxVixibility property of the Column.Header to Alwasy and the CheckBoxSynchronization property to HeaderCheckBoxSynchronization in order to check and ucheck all rows.
However, after grouping the grouping the grid, the header check box does not work.
How can I use the header checkbox even after grouping??
Also, can I add a checkbox to every group to check and uncheck the rows of that group??
Hi,
Thank you for the reply.
The code was updating the cell values in the GroupByRowCheckBoxClicked (it also fires if the state of the checkbox was altered through code) event and it was doing it even when the state of the checkbox was Indeterminate. I have added a check so that it will set all checkboxes to false only if the state is Unchecked.
The header checkbox is in Indeterminate state because one of the cell should be checked (this was fixed in point 1). So when some cells but not all are checked the group by row checkbox should go to state Indeterminate. This is at least how the header checkbox behaves and I decided to implement it so both checkboxes work the same way. Let me know if you want to change this.
I have attached the modified sample. Feel free to modify it based on your custom needs.
Please let me know if you have any additional questions.
Hello,
Thank you for your sample code.
It has some more problems.
1. The check box in the grid cannot be clicked just one time for the first time, after check box clicked and then the other check box can be click one time.
2. As I said above, when I click check box for the first time, the check box cannot be checked. but the state of the check box of the parent group is changed to indeterminate state.
Please let me know how to solve them.
Thanks.
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
What you could do in order to synchronize the GroupByRow checkbox with the child checkboxes is to create a method which checks whether the rows collection of the parent row has all its checkboxes checked and assign value to the checkbox according to this. You have to call this method on CellChange event and also on the AfterRowExpanded. Also to you need to handle the AfterHeaderCheckStateChanged and set the checkbox state of all group by rows to the value of the header, if the value is not Indeterminate (this would mean that either all cells are checked or unchecked, so all group by checkboxes also must be with this CheckedState). One more thing you need to add is to make sure that every group by row has a CheckBoxUIElement for a Tag as the RowUIElement, won’t be created unless it’s shown on the screen and you need to keep the checkbox value in something.
I have modified my sample in order to demonstrate these suggestions.
Thank you for your response.
Then, is it possible that the state of the group check box made by CreationFilter can be changed with the check box of a single row in a group.
For example, I checked the group check box to select all, and then if I uncheck a check box of a single row in a group, then the state of the group check box also should be unchecked.
Also, if I check all of check boxes in a group, then the state of the group check box also should be checked.