1

こんにちは、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()
%>

助けが必要

4

1 に答える 1

0

アクション リンクの使用方法については、こちらで説明しています。

于 2013-11-07T08:35:46.487 に答える