I have a DropDownlist and Kendo Grid. If value selected in dropdownlist is 1 the cells in the Grid should be editable, and if the selected value is 2 the cells in the grid should not be editable. The following is the code for Kendo Grid.
@(Html.Kendo().Grid(Model.Data.Items)
.Name("Grid1")
.Columns(columns =>
{
columns.Bound(p => p.first).Title("first").Width(100).HeaderHtmlAttributes(new { style = "text-align:center;font-weight:bold" }).HtmlAttributes(new { style = "text-align: right;" }).Format("{0:N}").ClientTemplate("");
columns.Bound(p => p.second).Title("second").Width(100).HeaderHtmlAttributes(new { style = "text-align:center;font-weight:bold" }).HtmlAttributes(new { style = "text-align: right;" }).Format("{0:N}");
columns.Bound(p => p.third).Title("Third").Width(100).HeaderHtmlAttributes(new { style = "text-align:center;font-weight:bold" }).HtmlAttributes(new { style = "text-align: center;" });
})
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(true)
.Model(Model=> { Model.Id(p => p.first); })
)
.Selectable()
.Editable(editable => editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom))
.Scrollable(scr => scr.Height(179)))
Using I can edit the cell at all times, but I need a condition where the cells should not be editable when dropdownlist selected value changes. (Note:Grid is in .cshtml(view) page, not in js file.)
Please help me with this.