Hi there,
I am trying to get an MVC Kendo UI Grid on the sorting event of a particular column to sort by a different property in the bound model class. Is this possible - I've tried defining the Sortable comparer (http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.sortable.compare) but can't seem to get the syntax working. Below is my cshtml view code - for the SampleResultsOverview column I need the sort value to be bound to a different property on the site model instead - the property is called SampleResultsOverviewSortOrder.
Many thanks, Mark.
.Columns(columns =>
{
columns.Bound(site => site.UPRN).Title("UPRN");
columns.Bound(site => site.AddressWithPostcode).Title("Address");
columns.Bound(site => site.Contact).Title("Contact");
columns.Bound(site => site.Telephone).Title("Telephone");
columns.Bound(site => site.SampleResultsOverview).Title(@RecActionHeader).Encoded(false).Sortable(
compare: function (a, b) {
return numbers[a.name] - numbers[b.name];
);
columns.Template(site => { }).ClientTemplate(" ").Title("Site Documents");
})