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 perform Sorting on ForeignKey column while using Remote Data

Platform: ASP.NET Web Forms |
Control: Grid

Usually, foreignkey column in the Grid will be sorted based on the foreignKeyField which is the default behavior in the local data or remote data binding. In the local databinding, it can overcome by using the ej.foreignKeyAdaptor of DataManager. in the remote databinding, ej adaptors can handle this behavior in the server-end and sort the foreignkey column based on the foreignKeyValue instead of the foreignKeyField.

Please make a note that this solution will work only for the single column sorting.

In the server-end, for a foreignkey column, a separate method SortFor has been defined which will receive the Grid data, Foreignkey column data and Sort query. Using this, sorting has been done to the Foreignkey data which has been mapped back to the Grid datasource.









Angular 2 with MVC backend




Asp.Net core:



Figure: Grid Sorted with the ForeignKeyValue

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
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