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. (Last updated on : Nov 16th 2018).
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

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.

 

Razor:

 

 

 

Webforms:

 

 

Angular 2 with MVC backend

 

 

 

Asp.Net core:

 

 

Figure: Grid Sorted with the ForeignKeyValue

Article ID: Published Date: Last Revised Date: Platform: Control:
8949 07/11/2018 07/11/2018 ASP.NET Core Grid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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