This question is locked. New answers and comments are not allowed.
I have a project made with MVC3 RC with Razor and with Telerik's Menu and PanelBar controls (version 2010.3.1110.235). It was working well. I updated the project to MVC3 RC2 and everything still works properly. But after adding a new model class nothing works. I got the error:
CS1593: Delegate 'System.Action<Telerik.Web.Mvc.UI.MenuItem, LoyaltyCRM.Model.ModelAccess.tfnGetAllOptionsResult>' does not take 1 arguments.
I deleted the new class added and it still doesn't work. I recover a backup before adding the model class and it works but when I tried to create a new View and the Menu control doesn't recognize the former model.
Here is an example of the code that is working:
And here is the new code I try to create:
When I press . after BindTo to see what IntelliSense gives the option for For<> does not appear, instead it shows the options of telerik menu item. In the original View when you press the . after BindTo IntelliSense shows Equals, For<>, GetHashCode, GetType and ToString.
I think BindTo is not considering the model Model.Models like an IEnumerable (I've declared it as IList) and that's is why is not working. The problem is that I don't know how to solve it.
Any suggestion?
Thanks in advance.
Juan Pablo
CS1593: Delegate 'System.Action<Telerik.Web.Mvc.UI.MenuItem, LoyaltyCRM.Model.ModelAccess.tfnGetAllOptionsResult>' does not take 1 arguments.
I deleted the new class added and it still doesn't work. I recover a backup before adding the model class and it works but when I tried to create a new View and the Menu control doesn't recognize the former model.
Here is an example of the code that is working:
@model LoyaltyCRM.Model.ViewModels.Authorizations.ViewModelAuthorizedOptions
@using Telerik.Web.Mvc.UI
@using LoyaltyCRM.Model.ModelAccess
<
br
class
=
"fclear"
/>
@(Html.Telerik().Menu()
.Name("MainMenu")
.BindTo(Model.Models, mapping => mapping
.For<
tfnGetAllAuthorizedMastersOptionsResult
>(binding => binding
.ItemDataBound((item, o) =>
{
item.Visible = true;
if (o.Controller!=null)
item.ControllerName = o.Controller;
if (o.Action!=null)
item.ActionName = o.Action;
if (o.Url != null)
item.Url = (o.Url.StartsWith("/") ? "/" + Model.SessionVariables.User.Culture : "") + o.Url;
if (o.HtmlAttributes!=null)
item.HtmlAttributes.Add("Style", o.HtmlAttributes);
if (o.ImageUrl != null)
{
item.ImageUrl = o.ImageUrl;
if (o.Cultures_Alt != null)
item.ImageHtmlAttributes.Add("Alt", o.Cultures_Alt);
And here is the new code I try to create:
@model LoyaltyCRM.Model.ViewModels.Users.ViewModelOptions
@using Telerik.Web.Mvc.UI
@using LoyaltyCRM.Model.ModelAccess
<
br
class
=
"fclear"
/>
@(Html.Telerik().Menu()
.Name("MainMenu")
.BindTo(Model.Models, mapping => mapping
When I press . after BindTo to see what IntelliSense gives the option for For<> does not appear, instead it shows the options of telerik menu item. In the original View when you press the . after BindTo IntelliSense shows Equals, For<>, GetHashCode, GetType and ToString.
I think BindTo is not considering the model Model.Models like an IEnumerable (I've declared it as IList) and that's is why is not working. The problem is that I don't know how to solve it.
Any suggestion?
Thanks in advance.
Juan Pablo