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

Sorting Proprogrammatically Two Columns

Good afternoon. Is it possible to order a sfdatagrid programmatically with two columns? Thanks for the help.

3 Replies

JP Jagadeesan Pichaimuthu Syncfusion Team February 20, 2019 06:58 AM UTC

Hi Antonio, 

Thanks for using Syncfusion product. 

You can able to programmatically sort the multiple columns by using the SortColumnDescriptions property in SfDataGrid. Please find the code snippet below to sort the two columns programmatically, 

this.sfDataGrid.SortColumnDescriptions.Add(new SortColumnDescription(){ ColumnName = "OrderID" }); 
this.sfDataGrid.SortColumnDescriptions.Add(new SortColumnDescription() { ColumnName = "CustomerID" }); 

Let us know whether this helps also if you need any further assistance on this. 


AN Antonio February 20, 2019 08:07 AM UTC


Thank you very much Jagadeesan  for you support.


JP Jagadeesan Pichaimuthu Syncfusion Team February 20, 2019 09:23 AM UTC

Hi Antonio, 

Thanks for your update. 

We are glad to know that the provided solution worked at your end. Please let us know if you have any further queries on this. We are happy to help you. 


Live Chat Icon For mobile
Up arrow icon