A: need to set the Model.Id in the DataSource for the grid. otherwise all new record will have id=0 which causes the controller action be triggered multiple times.
Q: how to disable batch update
A: should not have command.Save() in the toolbar
Q: server bound vs ajax bound
A: server bound: default binding for Kendo Grid, to bind the grid with data you just need to set its data source and render the view
ajax bound: Kendo Grid will make ajax requests when doing paging, sorting, filtering or saving data
Q: how to customize the way a property is displayed in a grid bound column
A: server bound: use the Template method
Ajax bound: use the ClientTemplate method
Q: How to send values to the action method when binding the grid
A:
If the grid is server bound the overload method which accepts route values should be used.
Example: Send Additional Data In Server Bound Grid
If the grid is ajax bound the
Data
method should be used to specify the name of the JavaScriptfunction which will return the additional data.
Example: Send Additional Data In Ajax Bound Grid
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(o => o.MyIDField);
})
No comments:
Post a Comment