This question is locked. New answers and comments are not allowed.
I'm trying to set up a two-level PanelBar, using the "Binding to Hierarchical Model" example as my starting point, and I'm getting this error:
"The best overloaded method match for 'Telerik.Web.Mvc.UI.PanelBarBuilder.BindTo(System.Collections.IEnumerable, System.Action<Telerik.Web.Mvc.UI.NavigationBindingFactory<Telerik.Web.Mvc.UI.PanelBarItem>>)' has some invalid arguments.
The only change is that instead of drawing from "category" and "product" tables, I'm drawing from "Client" and "ActionItem" tables. After pasting the PanelBar code into my page, I've switched the names, as follows:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="MvcApplicationCsharp.Models" %>
<%@ Import Namespace="Telerik.Web.Mvc" %>
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"TitleContent"
runat
=
"server"
>
Home Page
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
<
h2
>
<%= Html.Encode(ViewData["Message"]) %></
h2
>
<
table
class
=
"TableLayout"
width
=
"100%"
>
<
tr
class
=
"TableLayout"
>
<
td
>
<%=
Html.Telerik().PanelBar()
.Name("PanelBar")
.BindTo(Model, mappings =>
{
mappings.For<
Client
>(binding => binding
.ItemDataBound((item, Client) =>
{
item.Text = Client.ClientName;
})
.Children(Client => Client.ActionItems));
mappings.For<
ActionItem
>(binding => binding
.ItemDataBound((item, ActionItem) =>
{
item.Text = ActionItem.ActionItemType.Text;
}));
})
%>
</
td
>
</
tr
>
</
table
>
</
asp:Content
>
Here's the controller class whose Index method invokes this view:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
MvcApplicationCsharp.Models;
namespace
MvcApplicationCsharp.Controllers
{
[HandleError]
public
class
HomeController : Controller
{
public
ActionResult Index()
{
ViewData[
"Message"
] =
"Welcome to ASP.NET MVC!"
;
DataClasses1DataContext ai =
new
DataClasses1DataContext();
return
View(ai.Clients);
}
public
ActionResult About()
{
return
View();
}
}
}
Thanks,
Ed