public static MvcHtmlString SortableHeader(this HtmlHelper row, string currentSort, string currentDirection, string columnId, string title, Func<object, string> actionFunc, object htmlAttributes = null)
 {
     var sortingInfo = new SortingParameters();
     sortingInfo.ActionFunc = actionFunc;
     sortingInfo.Sort = currentSort;
     sortingInfo.SortDirection = currentDirection;
     return row.SortableHeader(sortingInfo, columnId, title, htmlAttributes);
 }
        public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            var model = base.BindModel(controllerContext, bindingContext);
            var pagedModel = (ISortingParameters)model;

            if (pagedModel == null)
            {
                pagedModel = new SortingParameters();
            }

            return pagedModel;
        }