We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Problems with Grid

Thread ID:





82144 Jun 3,2009 10:31 AM Jun 5,2009 01:25 PM ASP.NET MVC (Classic) 1
Tags: Grid
Wendy Simmons
Asked On June 3, 2009 10:31 AM

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
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" %>




"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?



Administrator [Syncfusion]
Replied On June 5, 2009 01:25 PM

Hi Wendy,

Thanks for your interest in Syncfusion products.

The code attached seems to be correct with a small change.The value of ServerModePagingSortingMapper property should be controller name and followed by action method name.


Controller Name: Home
Sort Action method name: ServerModeSortingAction

The ServerModePagingSortingMapper should be as follows :

ViewData["GridModel"] = new MvcGridModel()
//Other properties to be added.

ServerModePagingSortingMapper = "Home/ServerModeSortingAction"


Please let us know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.