Posted 26 October 2020, 5:40 pm EST
Hi Michal,
You can use SortDescriptions to add sorting on the Price column whenever a group is created for the Name column as follows:
// Fires whenever a group is changed
private void GroupDescriptionsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
// Checking if a group is added on Name property
if(e.Action == NotifyCollectionChangedAction.Add && (e.NewItems[0] as PropertyGroupDescription).PropertyName == "Name")
{
// Adding ascending sort for price column
_flexGrid.CollectionView.SortDescriptions.Add(new SortDescription()
{
Direction = ListSortDirection.Ascending,
PropertyName = "Price"
});
}
}
Please refer the attached sample for the same. (see FlexGridSorting.zip)
Please let us know if you need any further assistance.
Regards,
Kartik
FlexGridSorting.zip