I am trying to bind a data table to Grid on button click.
I am able bind data, however
1. I want to show a blank grid when the page is loaded
2. Show data only on button click
When I bind the grid, the json response is coming as a JavaScript file to download
I have attacked the code of controller and view that I am using
Also the screenshot
4 Answers, 1 is accepted
Generally, there is no problem to show an empty Grid. You should either bind it to an empty collection initially, or use Ajax binding and set AutoBind(false).
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding
http://docs.kendoui.com/api/wrappers/aspnet-mvc/Kendo.Mvc.UI.Fluent/GridBuilder#methods-AutoBind(System.Boolean)
It looks like you want to pass aditional (filtering) parameters to the Grid Read action method. In this case you can configure a Javascript function to be executed when the Grid datasource's client read() method is called.
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding#pass-additional-data-to-the-action-method
http://docs.kendoui.com/api/web/grid#fields-dataSource
http://docs.kendoui.com/api/framework/datasource#methods-read
The fact that Internet Explorer offers to open/save the JSON response, suggests that the JSON response is sent with a wrong content-type, and/or that the browser doesn't support the response content-type. This is not related to Kendo UI.
https://www.google.com/search?q=do+you+want+to+open+save+json
https://www.google.com/search?q=internet+explorer+json+download
Regards,
Dimo
Telerik


Hi Dimo,
This link you provided above:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding#pass-additional-data-to-the-action-method
is coming back not found - I think this documents exactly what I am after, could you please provide a working link?
Thanks,
Phil.
Hi Phil,
In order to pass additional parameters when making a CRUD request, you can use the data method.
The JQuery syntax and the MVC syntax.
Best Regards,
Georgi Denchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.