Strange behaviour, really...
I have an ASP.NET MVC View with a form, and inside of it, a grid that I configure with code like:
@(Html.Kendo().Grid<Customer>()
.Name("gridSecondaryCustomers")
.Columns(columns =>
{
...
and then I bind it to local data (JavaScript array) with code like:
var grid = $("#gridSecondaryCustomers").data("kendoGrid");
localDataSource = new kendo.data.DataSource({ data: secondaryCustomers });
grid.setDataSource(localDataSource);
Last, I add items by code in the array, and refresh the grid with previous code.
Nothing is showing, so I suppose that the problem lies in the 'normal' configuration of the grid, that tries to go to the server, or something like that...
So I add this code:
...
.DataSource(ds => { ds.Ajax().ServerOperation(false); })
and now, magically, when I add an item to the array, I can see the grid populated correctly.
What puzzles me is that with this single line in the grid configuration, loading the page generates an HttpPost to the controller, that I cannot really track down to where it comes... :-(
Could you please help me? Please ask me for more information, if needed...
Thanks as always,
Andrea
I have an ASP.NET MVC View with a form, and inside of it, a grid that I configure with code like:
@(Html.Kendo().Grid<Customer>()
.Name("gridSecondaryCustomers")
.Columns(columns =>
{
...
and then I bind it to local data (JavaScript array) with code like:
var grid = $("#gridSecondaryCustomers").data("kendoGrid");
localDataSource = new kendo.data.DataSource({ data: secondaryCustomers });
grid.setDataSource(localDataSource);
Last, I add items by code in the array, and refresh the grid with previous code.
Nothing is showing, so I suppose that the problem lies in the 'normal' configuration of the grid, that tries to go to the server, or something like that...
So I add this code:
...
.DataSource(ds => { ds.Ajax().ServerOperation(false); })
and now, magically, when I add an item to the array, I can see the grid populated correctly.
What puzzles me is that with this single line in the grid configuration, loading the page generates an HttpPost to the controller, that I cannot really track down to where it comes... :-(
Could you please help me? Please ask me for more information, if needed...
Thanks as always,
Andrea