I'm working with a treeView data Binding in MVC, and I'm getting the following error:
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?