Hi,
In the following code snippet you see that we are using the MVC Wrapper of kendo ui grid with odata mechanism that gets its data from a controller in server side.
We want to use custom command buttons but we are getting an exception that says that we cannot use custom commands if we are not using server binding. But when we are using odata mechanism with data binding at controller stage, why this is not a server binding ?
Please help.
Thanks.
In the following code snippet you see that we are using the MVC Wrapper of kendo ui grid with odata mechanism that gets its data from a controller in server side.
We want to use custom command buttons but we are getting an exception that says that we cannot use custom commands if we are not using server binding. But when we are using odata mechanism with data binding at controller stage, why this is not a server binding ?
Please help.
Thanks.
<
div
>
@(Html.Kendo().Grid<
Item
>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.ItemCode);
columns.Bound(c => c.ItemName);
columns.Command(command => command.Custom("Details").Text("Details").Action("OpenDetailsForm", "Home")).Width(100);
})
.HtmlAttributes(new { style = "height: 380px;" })
.Scrollable()
.Selectable(o => o.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
.Sortable()
.Resizable(o => o.Columns(true))
.Reorderable(o => o.Columns(true))
.Filterable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(3))
.DataSource(dataSource => dataSource
.Custom()
.ServerSorting(true)
.ServerFiltering(true)
.ServerPaging(true)
.ServerGrouping(true)
.ServerAggregates(true)
.Schema(s => s.Total("Total").Data("Data"))
.Type("odata")
.PageSize(10)
.Transport(r => r.Read(c => c.Cache(true)).Read(a => a.Action("GetGridDataSource", "Home", new { entityName = typeof(Item).FullName }).DataType("json")))))
</
div
>