This is a migrated thread and some comments may be shown as answers.

[Solved] Problem with treeView MVC extention

0 Answers 90 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shaza
Top achievements
Rank 1
Shaza asked on 20 Apr 2011, 01:41 PM
I'm working with a treeView data Binding in MVC, and I'm getting the following error, on mappings:

Error   1   Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type


When I try to run the demo code:

<% Html.Telerik().TreeView()
 
 
 .Name("TeleTreeView")
    .BindTo(Model, mappings =>
    {
         mappings.For<Category>(binding => binding
        .ItemDataBound((item, category) =>
        {
            item.Text = category.CategoryName;
        })
        .Children(category => category.Products));
         mappings.For<Product>(binding => binding
        .ItemDataBound((item, product) =>
        {
            item.Text = product.ProductName;
       }));
})
   .Render(); %>


I've read that maybe I'm missing an assembly so I've added the Linq one:

<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>


Still having the same problem, any suggestions?
Tags
TreeView
Asked by
Shaza
Top achievements
Rank 1
Share this question
or