Feb 25, 2014 at 11:48 PM
Edited Feb 26, 2014 at 12:07 AM
I can't figure out how to override "grid-column" and "grid-dir".
var gridSortSettings = new QueryStringSortSettings
ColumnQueryParameterName = "OrderBy",
DirectionQueryParameterName = "OrderByDirection",
ColumnName = "RequestDate",
Direction = GridSortDirection.Descending
But QueryStringGridSettingsProvider.SortSettings has no setter.
If I implement my own IGridSettingsProvider, I can't call
because QueryStringFilterColumnHeaderRenderer is an internal class.
Is there anyway to use my own Sort Column and Sort Direction query string parameter names?
Not liking having to translate in my view, as I'm doing here:
public ActionResult Index(SearchRequestsQueryString qs)
qs.OrderBy = Request.QueryString["grid-column"];
qs.OrderByDirection = Request.QueryString["grid-dir"] == "0" ? "Asc" : "Desc";
var vm = new SearchRequestsRepository().GetSearchRequestsViewModel(qs, 10);
Also, because "grid-column" and "grid-dir" have dashes in them, I can't use MVC Model Binding on a query string class. Because variables with a dash in them are illegal. If they weren't illegal i'd just rename my query string class variables
to match the query string names so model binding could work it's magic. But I'd still much rather be able to define my own query string names