I noticed in my own code and in the demo here (Datagrid Grouping API demo (GitHub)) that when there is a default grouping set for when the page first loads (if (args.FirstRender)
is true for the datagrid), column sorting doesn't work.
However, if I remove the default grouping and then re-add the grouping, then column sorting does work.
Steps, for the Datagrid Grouping API demo (GitHub):
- Upon opening the page, try sorting a column in the grouped datagrid.
Problem result: the columns don't sort. - Click the X on the "Title" button to ungroup the datagrid.
- Sort a column.
Appropriate Result: The column sorts. - Group the datagrid by the "Title" column again by dragging it to the grouping area.
- Try sorting a column.
Appropriate Result: The column sorts.
Question: Is there a way to get the column sorting working on first render when there is a default grouping on first render?