2013-10-29 60 views
0

我是新來的劍道,並試圖通過Ajax的編輯與劍道UI電網合作 - http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-editing錯誤:「KendoGridAjaxBinding」這個名字不會在目前情況下存在

我想劍道網添加到我的視圖。這裏是我用我的視圖的代碼塊:

@(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 

我將不勝感激的任何想法,如何解決這個錯誤信息。

回答

1

很明顯,您的解決方案中沒有這樣的名稱空間。根據您的項目更改該名稱空間。

@(Html.Kendo().Grid<YourAjaxBindingDemo.Models.RoleViewModel() 
相關問題