-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SortableHeaderFor custom Model #23
Comments
Have you looked at this sample: https://github.com/sonnemaf/ReflectionIT.Mvc.Paging/blob/master/src/SampleApp/Views/Products/Index.cshtml ? I think you need to use the extra overload in which you specify the sort string. @Html.SortableHeaderFor(model => model.MyList.NameColumn, "MyList.NameColumn") |
Any further followups here? I am trying to do the exact same thing as the OP and can't get access to the SortableHeaderFor...everything else is looking fine. |
What I ultimately ended up doing was creating a class called ExtendedPagingList...then building an additional Helper method to work with any models that derive from ExtendedPagingList. It works the only thing is that it cannot infer the type of the elements in the PagingList....so you need to specify them in the function call to SortableHeaderFor, might be a way around this but after like 5 hours I don't care to dig. |
Can you create a project for this problem and publish it in a public github repository? I will have a look at it. Don't have time to create one myself. |
Describe the bug
My page contain @model CustomModel:
@model Test.Web.Models.CustomModel
CustomModel contain property PagingList:
public ReflectionIT.Mvc.Paging.PagingList MyList{ get; set; }
How i use SortableHeaderFor for columns from MyList from CustomModel?
@Html.SortableHeaderFor(model => model.MyList.NameColumn) ** Dont work
The text was updated successfully, but these errors were encountered: