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.

Sorting /paging grid with params in action ?

Thread ID:

Created:

Updated:

Platform:

Replies:

90955 Oct 26,2009 12:53 PM Oct 27,2009 03:48 PM ASP.NET MVC (Classic) 1
loading
Tags: Grid
Lukasz
Asked On October 26, 2009 12:53 PM

I made a view with grid control and it works fine with sorting and paging but only when action in controller that provides data to the grid has no parameters. When it has one parameter, sorting and paging operations go to the same method instead of sorting/paging action. Could anyone provide such an example. Perhaps the routing must be changed?

Balaji M [Syncfusion]
Replied On October 27, 2009 03:48 PM

Hi lukasz,

Thank you for your interst in Syncfusion products.

I have created a simple sample to this issue and in this sample Grid Paging/Sorting functions works when the

paging/sorting action has one parameter.

Please refer the following code snippet to achieve this.
public ActionResult Index()
{
GridPropertiesModel model = new GridPropertiesModel
{
DataSource =new NorthwindDBDataContext().Products.ToList(),
AutoFormat = Syncfusion.Mvc.Shared.Skins.Office2007Silver,
AllowSorting=true,
AllowPaging=true,
PageCount=5,
PageSize=10,
PagingSortingMapper="PagingAction",
Caption = "Product List"
};

ViewData["GridModel"] = model;
return View();
}

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult PagingAction(PagingParams args)
{
IEnumerable data = new NorthwindDBDataContext().Products.ToList();
return data.GridActions();
}


Please refer the sample from the below link.
http://files.syncfusion.com/support/grid_mvc/presale/P511/Mvc_SampleGrid.zip.

Please let me know if you have any concerns.

Regards,
M. Balaji.



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.

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.

;