This question is locked. New answers and comments are not allowed.
Dear All
I tried to understand model Binding for treeview and menu.
I was working with Centers and ProjectCenters in relationship 1 - * (one to many) and i tried more and more times to utilize the above snippet.
<%= Html.Telerik().TreeView()
.Name("TreeView")
.Theme("web20")
.BindTo(Model, mappings =>
{
mappings.For<Centers>(binding => binding
.ItemDataBound((item, category) =>
{
item.Text = category.txtName;
})
.Children(category => category.ProjectCenter));
mappings.For<ProjectCenters>(binding => binding
.ItemDataBound((item, product) =>
{
item.Text = product.ProjectName;
}));
})
%>
After a lot of errors when using mappings => mappings.For<>() and after examine some example with northwind entities, i found that when using the same Entity and EntitySet name the previous snippet work fine.
Is this the correct implementation or I've missed some step?
Thanks in advance
Roberto