Group Descending with GridGroupSettings or SfGrid.GroupColumn() function

Hi

When using Grids, I am able to group entries by using the following methods:

Grid Settings: <GridGroupSettings Columns="GroupColumns">

Or C# function: Grid.GroupColumn("NameOfColumn")

However, in both cases, I am not able to select if I want it to be sorted in ascending or descending order and I haven't found any information on how to do it or if it's even possible.


Any insight? Thanks in advanc


3 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team December 8, 2021 10:51 AM UTC

Hi Lazar, 

Greetings from Syncfusion support. 

We have validated your query and we would like to inform you that by default the sorting is performed in Ascending order. It is not possible to change the sort order while grouping. This is the default behavior of the grid. 

Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Marked as answer

FE Federico September 26, 2022 12:03 PM UTC

Hi, you can sort descending after the ActionCompletedHandler grouping event completes like this:

public void ActionCompletedHandler(ActionEventArgs<Entity> args)

{

        if ((args.Action == "Group") && (args.ColumnName == "Date")) {

            MyGrid.SortColumnAsync("Date", SortDirection.Descending);

        }

}



MS Monisha Saravanan Syncfusion Team September 27, 2022 04:40 AM UTC

Hi Federico,


Thanks for the suggestion.


Yes, we can perform sorting in ActionCompleteEvent handler.


Regards,

Monisha


Loader.
Up arrow icon