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 contacting Infragistics Developer Support.
I have tested using Header CheckBox after grouping and it seems to me that it behaves as expected. The column with the checkbox still has it and it checks/unchecks the rows depending on the CheckBoxSynchronization property. What features do you think are not working? Do you want the checkbox to appear in the group by row itself? Do you group by the column with the checkbox?
I have attached my sample, let me know if it is missing something. Based on it, please answer my questions and I will be glad to continue investigating this case.
I am looking forward to your reply.
Thank you for your sample code.
I find out that set the HeaderPlacement property to "OncePerGroupedRowIsland", so header check box does not work.
I'd like to make the grid have below functions that
1) check and uncheck all rows when I click column header check box even after grouping
2) check and uncheck all rows just in a group when I click group header check box
Thank you for the clarification.
1) You can achieve this by setting the CheckBoxSynchronization property to “Band”. This will check/uncheck all the rows within the band.
2) You can add a CheckBox to the GroupByRow with the help of the CreationFilter interface. In it you can add a CheckBoxUIElement at the start of a GroupByRowUIElement and handle the element click event for the CheckBoxUIElement. In this event you can get all of the cells from the checkbox column and set their value according to the CheckedState of the CheckBoxUIElment. For more information on the CreationFilter interface please visit this link: http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/HTML/Win_Creation_Filter.html
I have modified my sample in order to demonstrate these suggestions.
Please let know if you have any additional questions.
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.
Hello,
Thank you for the reply.
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.
Please let me know if you have any additional questions.
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.
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.