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
Figure: Grid Sorted with the ForeignKeyValue
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|
|8948||07/11/2018||07/11/2018||ASP.NET Web Forms||Grid|