Hi, i was using a grid with a CheckBox in the header. Now i want to group the items and i was succeed in it also. When i checked the CheckBox in the header of the particular group, all the items of that group are also checked. It seems very good for me.
But when i checked the CheckBox as i marked with red circle in the attachment, i want all the items to be checked, which i was able to achieve before grouping the items.
Can you post a small sample project demonstrating this behavior? I tried it out and it works correctly for me.
My guess is that there is some other factor at work here, like something in your code that is causing the header checkbox to get out of synch.
Hai Chris,
I am using Infragistics 2010. In my grid, i am using header checkbox for a checkbox column. When i select or de-select the header checkbox, all the value in the column get changed.
My Problem is If i tried to deselect the checkbox in the row, the header checkbox changed to Tri-State. Even after i deselected all rows, the tri-state of header is not changed. I need your guideance.
Hi, Chris,
It was exactly what i was looking for.
Thank you very much.
Hello Bishwa,
The functionality you are trying to achieve can be handled with a little bit of code in the UltraGrid's BeforeHeaderCheckStateChanged event handler, by calling SetHeaderCheckedState() on child RowsCollections for each row in e.Rows if it is a UltraGridGroupByRow. With the HeaderCheckBoxSynchronization set to RowsCollection, use the following code:
private void ultraGrid1_BeforeHeaderCheckStateChanged(object sender, BeforeHeaderCheckStateChangedEventArgs e) { // If the rows in the Rows collection are GroupByRows, // then call SetHeaderCheckedState on the child RowsCollection // Check IsCancelable to make sure we are only doing this when the Header CheckBox is clicked, not during synchronization. if (e.IsCancelable && e.NewCheckState != CheckState.Indeterminate && e.Rows != null && e.Rows.Count > 0 && e.Rows[0].IsGroupByRow) { int numRows = e.Rows.Count; for (int i = 0; i < numRows; i++) { UltraGridGroupByRow groupByRow = e.Rows[i] as UltraGridGroupByRow; e.Column.SetHeaderCheckedState(groupByRow.Rows, e.NewCheckState); } } }
This will hopefully meet your needs. Let me know if you require further assistance.
Thanks,
Chris
Hi Chris
Thank you for your quick response.
I change the HeaderCheckBoxSynchronization property to Band, in this case even if i checked in the header of GroupRow all the items are checked. I tried with all four properties of HeaderCheckBoxSynchronization but no luck.
What i basically looking for is as:
IF i check on the CheckBox in Red mark, i want all the items to be checked. and if i check the CheckBox in yellow mark, i want items of its child bands only to be checked, in this case, for example if i check the checkbox under yellow mark only two items to be checked and rest should be in its usual condition.
Is there any property i am missing.
Thank you
Bishwa