I am trying to do the same thing but I cannot get my column to be read only. I can't get it to work even by setting the column to Editable(false) in the model. Maybe I have something else wrong in the grid?
@(Html.Kendo().Grid(Model)
.Name("gvLaboratories")
.Columns(columns =>
{
columns.Command(command => { command.Edit(); }).Width(50);
columns.Bound(l => l.ID);
columns.Bound(l => l.Description);
columns.Command(command => { command.Destroy(); }).Width(50);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable()
.Sortable()
.DataSource(dataSource => dataSource
.Server()
.Model(model =>
{
model.Id(l => l.ID);
model.Field(field => field.ID).Editable(false);
model.Field(field => field.Description).Editable(false);
})
.Create(create => create.Action("AddLaboratory", "SystemAdmin"))
.Read(read => read.Action("Laboratories", "SystemAdmin"))
.Update(update => update.Action("UpdateLaboratory", "SystemAdmin"))
.Destroy(destroy => destroy.Action("DeleteLaboratory", "SystemAdmin"))
)
)
The Editable(false) doesn't seem to do anything. The grid is still editable and I can add and edit both columns.