I have written the following code using ASP.NET MVC3 and it's throwing me an error at the bold line(.Model(Function(model) model.id(Function(p) p.CostCentreID)
. It's saying that the expression does not produce a value? I thought it's asking for a primary key column only? Isn't that the case?
Please help
@ModelType IEnumerable(Of Mail.BAL.CostCentre)
@Code
ViewData("Title") = "Index"
End Code
@(Html.Kendo().Grid(Model) _
.Name("CostCentres") _
.Columns(Function(modelItem) modelItem.Bound(Function(p) p.CostCentreID).Hidden) _
.Columns(Function(modelItem) modelItem.Bound(Function(p) p.CostCentre)) _
.Columns(Function(modelItem) modelItem.Bound(Function(p) p.Active)) _
.ToolBar(Function(toolbar) toolbar.Create()) _
.Groupable() _
.Pageable() _
.Sortable() _
.Scrollable() _
.DataSource(Function(datasource) datasource _
.Ajax() _
**.Model(Function(model) model.Id(Function(p) p.CostCentreID)) _**
.Create(Function(create) create.Action("Create", "Home")))
)