Just sta开发者_JS百科rted learning to use the grid so please excuse me for the possibly trivial question.
How can I sort by a column that uses another table property? For ex.
column.For(cust => cust.LinkedTable.someProperty).Sortable(true);
definition results in a "Could not find a property called 'someProperty' on type MyProject.Models.Node" error (obvious - the property is actually MyProject.Models.Node.LinkedTable.someProperty)
One of my ideas was to create a helper:
column.For(cust => Helpers.ViewHelper.GetSomeProperty(cust)).Sortable(true);
This doesn't produce the error, but a column isn't getting sorted anyways.
In another words, is there any way to pass a string value to a column and make it sortable?
Should probably rewrite my sort function (just a OrderBy(...) now), but I don't really know how to start:) Any help would be appreciated!
You can do it like this:
column.For(cust => cust.LinkedTable.someProperty).SortColumnName(somePropertyID)
where somePropertyID
is a attribute of table cust
.
I would like to recommend you the JQuery grid
Check it out, it's very useful
精彩评论