Have a datagrid with AllowSorting=true, AllowMultiColumnSorting="true", and ShowMultiColumnSortingIndex="true"
I'm handling the grid Sort event as I have to provide sort info to gRPC for actual sorting.
When I iterate the columns the col.GetOrderIndex is always returning null. Am I missing something? Here's a simple loop I was using for testing (would simplify and sort with LINQ for final):
protected async Task HandleSortEvent( DataGridColumnSortEventArgs args)
{
var visibleColumns = grid.ColumnsCollection.Where(
c => c.GetVisible()).ToList();
foreach (var col in visibleColumns)
{ string? colname = col.Property;
if (string.IsNullOrEmpty(colname)) continue;
SortOrder? srtorder = col.GetSortOrder();
if (col.Sortable && srtorder != null)
{ int? idx = col.GetOrderIndex();
// at this point idx is always null
// note: srtorder - is correct
}
}
}