Hi I want to disable certain columns while editing Columns (addDate and ModifiedDate). I was searching something like Telerik isEditable(false) but I cant find it. Here is code of my grid:
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Title);
columns.Bound(p => p.Author);
columns.Bound(p => p.BookGenreId);
columns.Bound(p => p.ReleaseDate);
columns.Bound(p => p.ISBN);
columns.Bound(p => p.Count);
columns.Bound(p => p.AddDate);
columns.Bound(p => p.ModifiedDate);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.DataSource(dataSource => dataSource
.Server()
// Specify that the ProductID property is the unique identifier of the model
.Model(model => model.Id(p => p.BookId))
.Create(create => create.Action("Create", "Books"))
.Read(read => read.Action("Index", "Books"))
.Update(update => update.Action("Update", "Books"))
.Destroy(destroy => destroy.Action("Destroy", "Books"))
)
)
Resolved by
.Model(model =>
{
//The unique identifier (primary key) of the model is the ProductID property
model.Id(p => p.BookId);
model.Field(p => p.ModifiedDate).Editable(false);
model.Field(p => p.AddDate).Editable(false);
})