0

私は MVC が初めてで、モデルにバインドする Kendo Grid を使用してビューを作成しようとしています。

私の見解は

@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

私のモデルは

Public Class GridDetail

    Public Property GridDetailPersons As IQueryable(Of Person)
    Public Property Message As String

End Class

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

残念ながら、私は自分のモデルにバインドできないようです。VS でエラー (Model.GridDetailPersons の下の波線) が表示され、クラス 'GridBuilder(Of Person)' はデフォルトのプロパティがないため、インデックスを作成できません。

行をHtml.Kendo().Grid(Of Model.GridDetailPersons)()エラーに変更すると、Type 'Model.GridDetailPersons' is not defined に変わります。

私は何を間違っていますか...特にrazor vb構文を使用している場合、そこにはほとんどありません。

私のグリッドは表示のみに使用されます...編集、追加、または削除は必要ありません。

4

0 に答える 0