We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to programatically obtain the Column name and Order of Sorting no matter on clicking the GridGroupingControl Columns?

Platform: ASP.NET Web Forms (Classic) |
Control: GridGroupingControl


To obtain the column name and order of sorting by clicking the column name when the GridControl is grouped by any of the column, the SortedItemsInGroup event can be used to obtain this. Please refer the below code snippet which illustrates this:


this.GridGroupingControl1.SortedItemsInGroup += new GroupEventHandler(GridGroupingControl1_SortedItemsInGroup);

void GridGroupingControl1_SortedItemsInGroup(object sender, GroupEventArgs e)


SortColumnDescriptorCollection collection = e.Group.Details.ParentTableDescriptor.SortedColumns;

foreach (SortColumnDescriptor sort in collection)


//Get the name of Sorted Columns

this.TextBox1.Text +=" " + sort.GetName();

//Get the Direction

this.TextBox1.Text += " " + sort.SortDirection;




AddHandler GridGroupingControl1.SortedItemsInGroup, AddressOf GridGroupingControl1_SortedItemsInGroup

Private Sub GridGroupingControl1_SortedItemsInGroup(ByVal sender As Object, ByVal e As GroupEventArgs)

Dim collection As SortColumnDescriptorCollection = e.Group.Details.ParentTableDescriptor.SortedColumns

For Each sort As SortColumnDescriptor In collection

'Get the name of Sorted Columns

Me.TextBox1.Text &= " " & sort.GetName()

'Get the Direction

Me.TextBox1.Text &= " " & sort.SortDirection

Next sort

End Sub



You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile