I can't get the sorting to work.
I'm just trying to follow your example but using my own database. I get the grid displayed OK (although NOT the DateTime columns) but I can't get the sorting to work. I have a controller that inherits from System.Web.Mvc controller with th following
public ActionResult Grid()
{
ViewData["GridModel"] = new MvcGridModel()
{
DataSource = context.flypros.Skip(0).Take(2).ToList(),
SkinName = "Syncfusion-Grid-Office2007Black",
ActionMode = "Server",
AllowDragAndDrop = true,
AllowGrouping = false,
ServerModePagingSortingMapper = "ServerModeSortingAction",
AllowResizing = true,
AllowSelection = true,
AllowEditing = false,
AllowPaging = false,
ShowCaption = true,
CaptionText = "Flypros",
AllowSorting = true,
HeaderText = { "Flypro ID", "Name", "Comments", "StatusID"},
PrimaryKeyColumns = { "Flypro ID" }
};
return View();
}
//On Sorting Action
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult ServerModeSortingAction()
{
IEnumerable data = context.flypros.Skip(0).Take(2).ToList();
return data.MvcGridActions
();
}
}
and here is the view:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
Grid
Grid
<%Html.Grid(
"mvcgridservermode", "GridModel", column =>{
column.Add(p => p.id);
column.Add(p => p.name);
column.Add(p => p.comments);
column.Add(p => p.status_id);
column.Add(p => p.source_ato);
}); %>
Please can you suggest why my "ServerModeSortingAction" method is not being called?
Wendy
Grid_864345d2.aspx