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

MVC Grid return other control values in ajax postback

Thread ID:





100821 Sep 7,2011 08:07 PM UTC Sep 12,2011 03:00 PM UTC ASP.NET Web Forms (Classic) 2
Tags: GridGroupingControl
Steven Hunt
Asked On September 7, 2011 08:07 PM UTC

I want to have an MVC grid with some controls on the top that the user can use to filter the data. For example, I might have a checkbox on top of the grid saying: "Show only Rows of Type X"
After the first page is displayed and the user clicks to view the next row (or sorts, filters,etc.) I need the post to my controller to include the state of the controls like the checkbox as these will need to be part of the query used to get the next page.

How can I include them in the info posted back? If I just wrap the controls and the grid in an Html.BeginForm in my view, will this work?

Steven Hunt
Replied On September 8, 2011 07:09 PM UTC

Just realized there is a separate forum for MVC. Moved it there....

Sridhar N [Syncfusion]
Replied On September 12, 2011 03:00 PM UTC

Hi Stevan,

Thanks for your interest in Syncfusion Products.

Your requirement can be achieved by handling OnActionBegin event and set the control value to grid arguments. Please refer the below code snippet.


<%using (Html.BeginForm("Index","Home"))
<%=Html.CheckBox("Check",true) %>

<% =Html.Syncfusion().Grid("Grid2")
.AutoFormat(Skins.Sandune).EnableGrouping().ClientSideEvents(events => { events.OnActionBegin("OnActionBegin"); })

<% } %>


public ActionResult Index(PagingParams args, bool Check)
//Check is the checkbox state
var data1 = new NorthwindDataContext().Employees.Take(50).ToList();
ViewData["Griddata2"] = data1;
return data1.GridActions();


function OnActionBegin(sender, args)
//Check box state
var check = $('#Check')[0].checked;
args.data["Check"] = check;

For your convenience, we have created sample and the same can be downloaded from the following link.


Please let me know if you have any other questions or concerns.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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