I have a simple grid w/ ajax binding and some nested grids, all i want to do is have an inline edit for one field and set the other 2 to readonly. One of the fields is a bool and when i set Editable(false) in the datasource model i get an exception saying that the value passed to the dictionary is null but with Editable(true) or no Editable call it works fine. The RequireAll bool shouldnt be changeable in this grid, its just there for reference.
@(Html.Kendo().Grid<
ScheduleQual
>().BindTo(Model.Quals)
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.Qual.Name).Title("Name");
columns.Bound(p => p.Id).Hidden();
columns.Bound(p => p.Qual.RequireAll);
columns.Bound(p => p.Required);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Sortable()
.ClientDetailTemplateId("template")
.Scrollable(scr => scr.Height(430))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(20)
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Qual.Name).Editable(false);
model.Field(p => p.Qual.RequireAll);//this is the field i want to make readonly
model.Field(p => p.Required).DefaultValue(0).Editable(true);
})
.Read(read => read.Action("HierarchyBinding_Quals", "Scheduling"))
)
.Events(events => events.DataBound("dataBound"))
)
Maybe i'm just doing something wrong, i just started using these controls.
As a side note i've noticed that sometimes the RequireAll column renders as 'true' or 'false' and sometimes with a green icon that says Yes. is it possible to force the icon style to display when readonly instead of the true false?
John