Hi there,
I am using the KendoUI grid control on two MVC views where the user needs the ability to edit the data on each grid. The proposed solution is to redirect to an "Edit" and "Delete" view if the user clicks on the "Edit" or "Delete" buttons.
I currently have this working for one of the grids, but the second grid only allows me to edit the data inline. The definition of the grids are identical (apart from the columns, model, and actions).
How can I disable the inline editing of the second grid so that it redirects to an MVC view instead?
This code works as expected and redirects to the "Edit" and "Delete" views.
This code DOES NOT work as expected and performs an in-line edit
I am using the KendoUI grid control on two MVC views where the user needs the ability to edit the data on each grid. The proposed solution is to redirect to an "Edit" and "Delete" view if the user clicks on the "Edit" or "Delete" buttons.
I currently have this working for one of the grids, but the second grid only allows me to edit the data inline. The definition of the grids are identical (apart from the columns, model, and actions).
How can I disable the inline editing of the second grid so that it redirects to an MVC view instead?
This code works as expected and redirects to the "Edit" and "Delete" views.
<%:Html.Kendo().Grid(Model)
.Name("players")
.Columns(columns =>
{
columns.Bound(p => p.FullName);
columns.Bound(p => p.MobilePhone);
columns.Bound(p => p.EmailAddress);
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(200);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Model(model => model.Id(p => p.PlayerId))
.Read(read => read.Action("Edit", "Player"))
.Update(update => update.Action("Edit", "Player"))
.Destroy(update => update.Action("Delete", "Player")))
%>
This code DOES NOT work as expected and performs an in-line edit
<%:Html.Kendo().Grid(Model)
.Name("articles")
.Columns(columns =>
{
columns.Bound(a => a.Date);
columns.Bound(a => a.Title);
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(200);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Model(model => model.Id(a => a.ArticleId))
.Read(read => read.Action("Edit", "Article"))
.Update(update => update.Action("Edit", "Article"))
.Destroy(destroy => destroy.Action("Delete", "Article")))
%>