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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problems with Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

82144 Jun 3,2009 02:31 PM UTC Jun 5,2009 05:25 PM UTC ASP.NET MVC (Classic) 1
loading
Tags: Grid
Wendy Simmons
Asked On June 3, 2009 02:31 PM UTC

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

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

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.

Example:

Controller Name: Home
Sort Action method name: ServerModeSortingAction

The ServerModePagingSortingMapper should be as follows :

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

ServerModePagingSortingMapper = "Home/ServerModeSortingAction"

}

Please let us know if this helps.

Regards,
Muthukumar.

CONFIRMATION

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.

Warning Icon 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.Close Icon

;