Hi!
I have a feature request, where I have to activate grouping only if the group-operation will result in more than one group. If there will be only one group, I have to display a “flat” list. Is there an easy way how I can achieve such a behaviour?
To provide a little bit more background information.
Best regards,HiCo
Hello Hico,
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
Thank you for your feedback.
I have been further investigating the behavior that you have describe and it seems that it is expected. It is caused by Virtualization of XamDataGrid, you can read more details about it from the following link from our online documentation:
http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/xamData_Cells_CellValuePresenters_and_Cell_Virtualization.html
That I can suggest is to use the BringRecordIntoView method of XamDataGrid in the event where change the value of gender, so you will bring the record into view and the grid will group the data. Also you should use BeginInvoke method of Dispatcher and call in it UpdateGrouping, so you can achieve the functionality that you are looking for. I modified the last sample application to show you how you can implement this approach.
Please let me know if you need any further assistance on the matter.
Hi Zhivko,
My described "solutions" are just workarounds and not applicable in our case. The scenarios should work without them. :)
RegardsHiCo
I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Hi Zhivko!
Here are my steps for reproducing the problems:
Reproduction of Scenario 1
1. Load Persons (female only) => no grouping2. Change Gender => no grouping, although the last entry has now a different value.
This will work if you do the following:
1. Load Persons (female only) => no grouping2. Scroll to the last entry3. Change Gender => grouping works
Reproduction of Scenario 2
1. Load Persons (female only) => no grouping2. Scroll to the last entry3. Change Gender => grouping works4. Change Gender again => grouping still activated
1. Load Persons (female only) => no grouping2. Scroll to the last entry3. Change Gender => grouping works4. Expand group "Male"5. Change Gender again => grouping deaktivated => Correct
The reason for both problems is the missing ValueChanged-event if the records are not visible.
Best regardsHiCo