KENDO AJAX GRID HTMLHelper错误

时间:2013-11-07 03:55:03

标签: asp.net-mvc telerik kendo-grid telerik-grid

您好我在我的MVC项目中使用了KEndo Ajax Grid。我在我的网格中使用htmlhlper只是进入新页面,但我收到错误“mvc.HTMLHelper不包含ActionLink的定义和最佳扩展方法重载”

我的代码

     <%: Html.Kendo().Grid<KendoGridAjaxEditing2.Models.ProductViewModel>()
    .Name("grid")
          .Columns(columns =>
          {
              columns.Bound(product => product.CustomerID).Width(100);
              columns.Bound(product => product.CustomerName).Template(c => @Html.ActionLink(c.CustomerID, "ViewDetails", new { id = c.CustomerID }));
              columns.Bound(product => product.CustomerLastName).Width(250);
              columns.Bound(product => product.Customerage).Width(250);
              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(product => product.CustomerID); // Specify the property which is the unique identifier of the model
                    model.Field(product => product.CustomerID).Editable(false); // Make the ProductID property not editable
                })
                .Create(create => create.Action("Products_Create", "Home")) // Action invoked when the user saves a new data item
                .Read(read => read.Action("Products_Read", "Home"))  // Action invoked when the grid needs data
                .Update(update => update.Action("Products_Update", "Home"))  // Action invoked when the user saves an updated data item
                .Destroy(destroy => destroy.Action("Products_Destroy", "Home")) // Action invoked when the user removes a data item
          )
          .Pageable()
%>

需要帮助,谢谢

1 个答案:

答案 0 :(得分:0)

如何使用操作链接here