Is it possible to only group some rows, programmatically or otherwise?
What I'd like is for groups with only 1 item to appear as regular grid rows. In other words, only groups with 2 or more items show up as groups.
Hello Dierk,
Since the Visibility of the GroupByRecordPresenter is set internally via code, currently you are not able to use Style with a Trigger to control the Visibility and the only way is to use an event, where you can set it, but since there is virtualization, this approach won't work correcly if there are Records outside the viewable area, so my suggestion is to wait till the Prodict Idea I logged gets implemted. Also the External Data Processing feature would' help in implementing the functionality you want.
Hope this helps you.
Stefan,
Would the external data processing feature of the 12.2 release allow us to perform the grouping externally and hide the headers as desired without running into the virtualization problems? Or is the GroupByPresenter still beholden to the grid when data is processed externally?
If this was expected behavior it would have been helpful to have been made aware of that when the suggestion was made, even if it's documented somewhere.
I have not yet had a chance to play with the virtualization settings so I do not know how effective they will be.
I can say that this behavior is expected, because of the XamDataGrid's Virtualization and since for the mooment the best way for achieving the result you want is handling the Loaded event, which fires only when the GroupByrecordPresenter is created I can sugegst you either turn off the virtualization or wait till the Product Idea I logged for you gets implemented. Also if I think of another way for achieving this I will let you know.
Ok, I've run into some issues with this.
When there are more than a couple dozen items in the grid, the grouping behavior starts acting strangely. Sometimes groups no longer appear in the grid at all. Sometimes groups that SHOULD have a header don't. Sometimes a single item will end up in a group by itself and I'm unable to group or ungroup it without restarting my application. It's all very intermittent and only seems to show up when there are more than a handful of items in the grid.
Is there some sort of asynchronous behavior behind the scenes that I should be aware of that may be causing these issues? I'm using the GroupByPresenter_Loaded event as suggested. I also have a custom GroupByEvaluator for grouping things according to our own logic. Finally, I'm also customizing the GroupByRecordPresenter to display custom text and controls in the group header.
Please let me know if I can provide more information. It's difficult to describe the problem or pinpoint where it may be coming from.