0

私は剣道を初めて使用し、Kendo UI Grid を使用して Ajax 編集を試みています - http://docs.kendoui.c​​om /getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-editing

ビューに Kendo Grid を追加しようとしています。私のビューで使用しているコードブロックは次のとおりです。

@(Html.Kendo().Grid<KendoGridAjaxBinding.Models.RoleViewModel()
    .Name("grid")
    .Columns(columns =>
        {
            columns.Bound(role => role.RoleID).Width(100);
            columns.Bound(role => role.RoleName);
            columns.Command(commands =>
            {
                commands.Edit(); // The "edit" command will edit and update data items
                commands.Destroy(); // The "destroy" command removes data items
            }).Title("Commands").Width(200);
        })

        .ToolBar(toolbar => toolbar.Create()) // The "create" command adds new data items
        .Editable(editable => editable.Mode(GridEditMode.InLine)) // Use inline editing mode
        .DataSource(dataSource =>
            dataSource.Ajax()
            .Model(model =>
            {
                model.Id(role => role.RoleID); // Specify the property which is the unique identifier of the model
                model.Field(role => role.RoleName).Editable(false); // Make the ProductID property not editable
            })
            .Create(create => create.Action("Role_Create", "Home")) // Action invoked when the user saves a new data item
            .Read(read => read.Action("Role_Read", "Home"))  // Action invoked when the grid needs data
            .Update(update => update.Action("Role_Update", "Home"))  // Action invoked when the user saves an updated data item
            .Destroy(destroy => destroy.Action("Role_Destroy", "Home")) // Action invoked when the user removes a data item
        )
        .Pageable()
)

コンパイルして実行すると、次のエラーが発生します。

Compiler Error Message: CS0103: The name 'KendoGridAjaxBinding' does not exist in the current context

このエラー メッセージを解決する方法についてのアイデアをいただければ幸いです。

4

1 に答える 1

1

明らかに、ソリューションにそのような名前空間はありません。プロジェクトに応じてその名前空間を変更してください。

@(Html.Kendo().Grid<YourAjaxBindingDemo.Models.RoleViewModel()
于 2013-10-29T16:55:36.680 に答える