SortableHeaderFor custom Model
Describe the bug My page contain @model CustomModel: @model Test.Web.Models.CustomModel
CustomModel contain property PagingList: public ReflectionIT.Mvc.Paging.PagingList<MyType> MyList{ get; set; }
How i use SortableHeaderFor for columns from MyList from CustomModel? @Html.SortableHeaderFor(model => model.MyList.NameColumn) ** Dont work
@sonnemaf
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<T>...then building an additional Helper method to work with any models that derive from ExtendedPagingList<T>.
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.