I have the following grid:
@(Html.Kendo().Grid(Model.Items)
.Name("Items")
.Columns(columns =>
{
columns.Command(command => command.Custom("-").Click("deleteNominalInvoiceRowItem").HtmlAttributes(new { @class = "button-small", id = "deleteId" })).Width(40);
columns.Bound(c => c.Id).Hidden(true).FormClientTemplate("Items", "Items");
columns.Bound(c => c.NominalCode)
.ClientTemplate("#=NominalCode#")
.EditorTemplateName("NominalInvoiceItemAccountCodeTemplate")
.FormClientTemplate("Items", "Items");
columns.Bound(c => c.Description).FormClientTemplate("Items", "Items");
columns.Bound(c => c.NetAmount).HtmlAttributes(new { style = "text-align: right;" })
.ClientFooterTemplate("#= gridItemsFooterNetAmount() #").Format("{0:c}").FormClientTemplate("Items", "Items");
columns.Bound(c => c.VatAmount).HtmlAttributes(new { style = "text-align: right;" })
.ClientFooterTemplate("#= gridItemsFooterVatAmount() #").Format("{0:c}").FormClientTemplate("Items", "Items");
columns.Bound(c => c.TotalAmount).HtmlAttributes(new { style = "text-align: right;" })
.ClientFooterTemplate("#= gridItemsFooterTotalAmount() #").Format("{0:c}").FormClientTemplate("Items", "Items");
})
.HtmlAttributes(new { style = "height: 300px;" })
.Scrollable()
.Navigatable()
.Selectable(x => x.Mode(GridSelectionMode.Single).Type(GridSelectionType.Cell).Enabled(true))
.Editable(x => x.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom))
.ToolBar(x =>
{
x.Create().Text(RCdisplay.Add_Nominal_Invoice_Item);
x.Custom().Text(RCdisplay.Clear_All).HtmlAttributes(new { id = "clearItems" });
})
.Events(x => x.Edit("onNominalInvoiceItemsGridEdit").Change("onNominalInvoiceItemsGridEdit").Save("onNominalInvoiceItemsGridSave"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("InvoiceItemsGrid_Read", "Invoicing", new { Area = "Invoicing" }))
.Create(create => create.Action("InvoiceItemsGrid_Insert", "Invoicing", new { Area = "Invoicing" }))
.Update(update => update.Action("InvoiceItemsGrid_Update", "Invoicing", new { Area = "Invoicing" }))
.Model(m =>
{
m.Id(p => p.Id);
m.Field(p => p.NominalCode);
m.Field(p => p.Description);
m.Field(p => p.NetAmount);
m.Field(p => p.VatAmount);
m.Field(p => p.TotalAmount);
})
)
The EditorTemplateName causes the grid to have an empty cell (it actually contains a hidden field with the value selected) when not in edit mode.
From what i read, the ClientTemplate as I have it should display the value selected.
Is there anything else I need to do to get the selected value displayed as a span when not in edit more?
Thanks