【问题标题】:KENDO AJAX GRID HTMLHelper ErrorKENDO AJAX GRID HTMLHelper 错误
【发布时间】:2013-11-07 03:55:03
【问题描述】:

您好,我在我的 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()
%>

需要帮助,谢谢

【问题讨论】:

  • 有人能帮帮我吗?

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


【解决方案1】:

here 介绍了如何使用操作链接。

【讨论】:

  • 谢谢伙计,你能告诉我一件事,我是 asp.net mvc 的新手,所以这就是为什么我很挣扎我想在我的网格中添加 Dropbox 和复选框我已经看到了演示源代码以及从这里demos.kendoui.com/web/grid/editing.html 但在 EditingController.cs 我无法找到这个公共 ActionResult Editing_Read([DataSourceRequest] DataSourceRequest request) { return Json(SessionProductRepository.All().ToDataSourceResult(request)); }
  • SessionProductRepository *??有没有剑道演示的源代码
  • 是的,如果您已经使用 msi 安装程序安装了 MVC 扩展,您应该在 ProgramFIles/Telerik/Kendo 下有 MVC 演示...
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多