This question is locked. New answers and comments are not allowed.
Hi,
I am using AJAX Custom Binding on Razor. The GridModel data contains collection of AccountModel.
One of property in AccountModel is called "GroupName", so when I am sorting by this column the GridCommand sorting descriptor member will contain "GroupName".
Is there a way to have sorting name to be different than the property name? Say I want it so the sorting name to be "AccountName" rather than "GroupName".
In my view there should be attribute in the Model which we can utilise to specify the sorting name, ie "Sorting attribute".
This is very simple example, but is important for me - and yes I could do If statement when ajax call my search function on controller and check the property name before changing it to sorting name manually - but that is so not clean, and there has to be better option.
Thanks
Fandi
I am using AJAX Custom Binding on Razor. The GridModel data contains collection of AccountModel.
One of property in AccountModel is called "GroupName", so when I am sorting by this column the GridCommand sorting descriptor member will contain "GroupName".
Is there a way to have sorting name to be different than the property name? Say I want it so the sorting name to be "AccountName" rather than "GroupName".
In my view there should be attribute in the Model which we can utilise to specify the sorting name, ie "Sorting attribute".
This is very simple example, but is important for me - and yes I could do If statement when ajax call my search function on controller and check the property name before changing it to sorting name manually - but that is so not clean, and there has to be better option.
Public
Class
AccountModel
<Sorting(Name:=
"AccountName"
)> _
<Display(Name:=
"Group Name"
)> _
Public
Property
GroupName
As
String
End
Class
Thanks
Fandi