Hi Phil,
Your requirement to “Group a column in the actual order without sorting the
data” will be achievable by removing the grouped columns from the SortDescriptions
shown below,
this.sfDataGrid.Loaded += OnSfDataGridLoaded;
private void
OnSfDataGridLoaded(object sender, RoutedEventArgs e)
{
this.sfDataGrid.View.CurrentChanged
+= OnCurrentVoewChanged;
}
private void OnCurrentVoewChanged(object sender, object e)
{
// Get the
grouped column
var groupColumn
= sfDataGrid.View.SortDescriptions.FirstOrDefault(x => x.PropertyName == "CustomerID");
// Remove the
grouped column from the SortDescriptions
if
(sfDataGrid.SortColumnDescriptions.FirstOrDefault(x => x.ColumnName == "CustomerID") != null)
sfDataGrid.View.SortDescriptions.Remove(groupColumn);
}
|
Here we have prepared the sample for your reference, please
have a look at this.
Regards,
Dhanasekar M.
If this post is helpful, please consider Accepting it as the
solution so that other members can locate it more quickly.
Attachment:
SfDataGrid_WinUI_5adafb36.zip