This is a migrated thread and some comments may be shown as answers.

pass grid state to mvc controller

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dominik
Top achievements
Rank 1
Dominik asked on 16 Oct 2015, 02:03 PM

Is there a kendo model object that I can bind the grid options to in a mvc5 controller?

saveGridState: function (grid) {
            $.ajax({
                type: "POST",
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                url: url,
                data: JSON.stringify(grid.getOptions())
            });
        }

//controller method
[HttpPost]
public void SaveGridState(string gridState)
{
     
}

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 20 Oct 2015, 09:03 AM

Hello Dominik,

 

 

The Kendo UI Grid getOptions retrieves the options that are currently enabled or disabled on the Grid. The JSON.stringify method converts a JavaScript value to a JSON string. So basically it will be sent to the server as string value and the value should be parsed handled as a string on the server. 

 

 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Dominik
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or