This question is locked. New answers and comments are not allowed.
Stéphan Parrot
Top achievements
Rank 1
Stéphan Parrot
asked on 31 Aug 2010, 04:07 PM
Hello folks,
I have a ViewModel that contains a property as this one:
}
In my page, I have this:
In my web.config, all the namespaces are registered correctly, I've doubled checked everything with another colleague.
the problem is that it gives me a compilation error saying:
CS1593:'System.Action<Telerik.Web.Mvc.UI.MenuItem,SomeNS.SomeDto>' does not take '1' arguments
I've searched on google and found some posts on Telerik's forums but nothing pointed me in any directions as to why this is happening...
In the markup, the "mapping" variable is underlined with that same error message in the VS.Net 2010 editor...
Please, help, it's driving me crazy!
:)
I have a ViewModel that contains a property as this one:
public class MyViewModel { public IEnumerable<SomeDto> MyList { get; set; } }
namespace SomeNS
{
public class SomeDto { public string SomeText { get; set; } public IEnumerable<SomeDto> Children { get; set; } }}
In my page, I have this:
<%= Html.Telerik().Menu() .Name("menu") .Orientation(MenuOrientation.Vertical) .BindTo(Model.MyList, mappings => { mappings.For(binding=>binding .ItemDataBound((item, dto) => { item.Text = item.SomeText; }) .Children(dto => dto.Children)); })
%>In my web.config, all the namespaces are registered correctly, I've doubled checked everything with another colleague.
the problem is that it gives me a compilation error saying:
CS1593:'System.Action<Telerik.Web.Mvc.UI.MenuItem,SomeNS.SomeDto>' does not take '1' arguments
I've searched on google and found some posts on Telerik's forums but nothing pointed me in any directions as to why this is happening...
In the markup, the "mapping" variable is underlined with that same error message in the VS.Net 2010 editor...
Please, help, it's driving me crazy!
:)
6 Answers, 1 is accepted
0
Hi Stéphan Parrot,
This statement is invalid:
it should be
Unfortunately the compiler gets confused and reports a different error.
All the best,
Atanas Korchev
the Telerik team
This statement is invalid:
item.Text = item.SomeText; it should be
item.Text = dto.SomeText; Unfortunately the compiler gets confused and reports a different error.
All the best,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Stéphan Parrot
Top achievements
Rank 1
answered on 31 Aug 2010, 04:12 PM
Sorry, typo from editing the real code. I didn't want to post details that aren't relevant to my problem but, it's actually item.text = dto.SomeText;
The problem isn't there...
Thanks for the quick reply!
The problem isn't there...
Thanks for the quick reply!
0
Hi Stéphan Parrot,
Such errors occur if either there is a syntax error in the code inside ItemDataBound or if the ASP.NET compiler does not know that the Children property is IEnumerable. You can try commenting statements out to see if this would make a difference. If this does not help I suggest you open a support ticket and send us a sample project showing the problem.
Regards,
Atanas Korchev
the Telerik team
Such errors occur if either there is a syntax error in the code inside ItemDataBound or if the ASP.NET compiler does not know that the Children property is IEnumerable. You can try commenting statements out to see if this would make a difference. If this does not help I suggest you open a support ticket and send us a sample project showing the problem.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Stéphan Parrot
Top achievements
Rank 1
answered on 31 Aug 2010, 04:31 PM
No offense but, I'll manually generate the menu using plain old css and jQuery...
I've been wasting way too much time trying to make these control working and each and everytime we try something VERY simple, we always stump on some strange behaviors like this...
Even the code samples gives me this error so, it might be something that's broken in the release we use or my 15 years of experience in Web dev is coming to an end with a huge career change? :P
Seriously, my manager do not want me to waste anymore time on trying to make these work, unfortunately :(
Thanks for trying to help me, you are very fast at answering and trying to help but the product seems not to follow the same principles...
Regards.
I've been wasting way too much time trying to make these control working and each and everytime we try something VERY simple, we always stump on some strange behaviors like this...
Even the code samples gives me this error so, it might be something that's broken in the release we use or my 15 years of experience in Web dev is coming to an end with a huge career change? :P
Seriously, my manager do not want me to waste anymore time on trying to make these work, unfortunately :(
Thanks for trying to help me, you are very fast at answering and trying to help but the product seems not to follow the same principles...
Regards.
0
Hi Stéphan Parrot,
The problem is that you have missed the generic:
I am sending a sample project showing how to bind the menu.
Regards,
Atanas Korchev
the Telerik team
The problem is that you have missed the generic:
mappings.For<SomeNS.SomeDto>(binding=>binding I am sending a sample project showing how to bind the menu.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Stéphan Parrot
Top achievements
Rank 1
answered on 31 Aug 2010, 04:48 PM
Again, I've edited (too fast maybe) the code I wanted to send and removed this without realizing it...
In my real code, everything is in there, I've basically copied and pasted an example from Telerik's demos and worked it to fit my objects.
And like I've mentionned, I can no longer put time and efforts into using the menu control for the feature we need because my manager said so and, I think you know the drill! :)
Thanks again for the quick reply.
I'll look into this when I get home tonight because of my curiosity! :)
In my real code, everything is in there, I've basically copied and pasted an example from Telerik's demos and worked it to fit my objects.
And like I've mentionned, I can no longer put time and efforts into using the menu control for the feature we need because my manager said so and, I think you know the drill! :)
Thanks again for the quick reply.
I'll look into this when I get home tonight because of my curiosity! :)