I'm new to MVC and trying to produce a view with a Kendo Grid that will bind to a model.
My View has
@ModelType CDB.GridDetail
@Code
Html.Kendo().Grid(Model.GridDetailPersons)() _
.Name("Grid") _
.Columns(Sub(c) _
c.Bound(Function(s) s.PersonID End Function) _
c.Bound(Function(s) s.Status End Function) _
c.Bound(Function(s) s.OperationalTeam End Function) End Sub) _
.Pageable() _
.Sortable() _
.ToolBar(Function(t) t.Create() _
t.Custom().Name("myCustomCommand").Text("custom toolbar button") End Function) _
.Filterable() _
.DataSource(Function(d) d.Ajax() _
.PageSize(200) _
.ServerOperation(False) End Function) _
.Render()
End Code
My model are
Public Class GridDetail
Public Property GridDetailPersons As IQueryable(Of Person)
Public Property Message As String
End Class
and
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Public Class Person
<Required, StringLength(50), DisplayName("Person ID")>
Public Property PersonID As String
<DisplayName("Status")>
Public Property Status As String
<DisplayName("OPs Support Team")>
Public Property OperationsTeam As String
End Class
Unfortunately I don't seem to be able to bind to my model I get an error in VS (wavy line under Model.GridDetailPersons) which states Class 'GridBuilder(Of Person)' cannot be indexed because it has no default Property.
If I change the line to Html.Kendo().Grid(Of Model.GridDetailPersons)()
the error changes to Type 'Model.GridDetailPersons' is not defined.
What am I doing wrong... there is so little out there especially if using razor vb syntax.
My grid will be used for display only... no edit, add or delete will be required.