Hi,
I'm trying to use grouping feature of xamdatagrid. I would like to do initial default grouping by three fields and then allow user to rearrange or group accordingly as he wishes. Is that something that is possible? I'm using ListCollectionView and SortEvaluationMode = 'UseColllectionView'
Thanks
Hello RJ,
In order to initially group the XamDataGrid when using a collection view, I would recommend that you add a new PropertyGroupDescription to the GroupDescriptions collection of your ListCollectionView. Note, in order for this to work correctly, you will also need to set the GroupEvaluationMode property of your XamDataGrid.FieldLayoutSettings to "UseCollectionView." This essentially delegates the grouping work back to the collection view that is used as the DataSource of your XamDataGrid.
As an alternative, you can go without setting the UseCollectionView setting in this case, and add new FieldSortDescription elements to your XamDataGrid FieldLayout's SortedFields collection. You can read further about doing this here: https://ko.infragistics.com/help/wpf/xamdatapresenter-sorting-and-grouping-fields-programmatically.
I have attached a sample project to demonstrate the initial ListCollectionView grouping operation. I hope this helps.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Hi Andrew,
Thanks for the prompt reply. I'm using the FieldLayout SortedFields collection to add the grouping. But, one thing I noticed is that when I sort on a field, the expanded grid is collapsing. Is there a way to sort without collapsing? can I customize the header display? Can I give styling to the group headers?
Thanks,