문제

Just started 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!

도움이 되었습니까?

해결책

I would like to recommend you the JQuery grid

Check it out, it's very useful

다른 팁

You can do it like this:

column.For(cust => cust.LinkedTable.someProperty).SortColumnName(somePropertyID)

where somePropertyID is a attribute of table cust.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top