я нашел этот article и модифицированное решение.
using System;
using System.Web.Mvc;
using Kendo.Mvc;
using Kendo.Mvc.UI;
using Kendo.Mvc.UI.Fluent;
public static class NavigationItemBuilderExtensions
{
public static NavigationItemBuilder<TItem, TBuilder> Action<TItem, TBuilder>
(this NavigationItemBuilder<TItem, TBuilder> instance, ActionResult action)
where TItem : NavigationItem<TItem>
where TBuilder : NavigationItemBuilder<TItem, TBuilder>, IHideObjectMembers
{
return Action<NavigationItemBuilder<TItem, TBuilder>>(instance, action);
}
public static CrudOperationBuilderBase<TBuilder> Action<TBuilder>
(this CrudOperationBuilderBase<TBuilder> instance, ActionResult action)
where TBuilder : CrudOperationBuilderBase<TBuilder>, IHideObjectMembers
{
return Action<CrudOperationBuilderBase<TBuilder>>(instance, action);
}
private static TResult Action<TResult>(dynamic instance, ActionResult action)
{
if (instance == null)
{
throw new ArgumentNullException("instance");
}
var actionResult = action as IT4MVCActionResult;
if (actionResult == null)
{
throw new NotSupportedException(
"An argument action must implement IT4MVCActionResult interface.");
}
instance.Action(
actionResult.Action,
actionResult.Controller,
actionResult.RouteValueDictionary);
return instance;
}
}
обычая показано ниже:
@(Html.Kendo()
.Grid<SomeModel>()
.Name("T4Grid")
.Columns(col =>
{
col.Bound(wf => wf.Name);
col.Bound(wf => wf.Description);
})
.DataSource(src => src
.Ajax()
.Read(read => read.Action(MVC.SomeArea.SomeController.SomeAction()))))
@(Html.Kendo()
.PanelBar()
.Name("T4PanelBar")
.Items(bar =>
{
bar.Add().Text("Index").Action(MVC.SomeArea.SomeController.SomeAction());
bar.Add().Text("Another").Action(MVC.SomeArea.SomeController.SomeAction2());
}))
Можете ли вы добавить соответствующий код на свой вопрос, так как это может помочь понять ваш вопрос – dvhh
@dvhh, да, конечно. – Neshta