Hi,
I've created a grid with a dynamic object and I'd like to use the GridEditMode.InLine to update and add data. The popUp mode is working but with the InCell and
the inline I'm getting the following error:
I tried to use a custom template but I am still getting the same error.
Thanks!
I've created a grid with a dynamic object and I'd like to use the GridEditMode.InLine to update and add data. The popUp mode is working but with the InCell and
the inline I'm getting the following error:
Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
Am I missing something?I tried to use a custom template but I am still getting the same error.
@(Html.Kendo().Grid<dynamic>()
.Name(
"Grid"
)
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(
true
)
.Model(cfg =>
{
cfg.Id(
"SsdID"
);
foreach
(var property
in
Model.PropertyDescriptors)
{
cfg.Field(property.Name, property.DataType);
}
})
.Read(cfg => cfg.Type(HttpVerbs.Post)
.Action(
"ReadDataForDefinition"
,
"ManualDataEntry"
,
new
{ id = Model.LDefinitionId }))
.Update(u => u.Type(HttpVerbs.Post).Action(
"UpdateDataForDefinition"
,
"ManualDataEntry"
,
new
{ id = Model.LDefinitionId }))
.Create(u => u.Type(HttpVerbs.Post).Action(
"Create"
,
"ManualDataEntry"
,
new
{ id = Model.LDefinitionId }))
)
.Resizable(resizing => resizing.Columns(
true
))
Columns(columns =>
{
foreach
(var property
in
Model.PropertyDescriptors.Where(desc => desc.DisplayOrder.HasValue))
{
var binding = columns.Bound(property.DataType, property.Name);
if
(property.DataType ==
typeof
(DateTime) || property.DataType ==
typeof
(DateTime?))
binding.Format(
"{0:d}"
);
binding.Column.Title = property.Label;
}
columns.Command(command =>
{
command.Edit();
command.Destroy();
});
})
.ToolBar(toolbar => { toolbar.Create(); })
.Pageable(paging =>
{
paging.ButtonCount(10);
paging.PreviousNext(
true
);
paging.PageSizes(
true
);
})
.Editable(edit => edit.Mode(GridEditMode.InLine))
.Sortable()
.Scrollable()
.Filterable()
)