The only way I have been able to get the first level to work, however, was to fully qualify my namespace when defining the IEnumerable<T> command and the first mappings.For<T> command.
In the code that I got from the Telerik menu example, there is no need to fully quaify classes inside the IEnumerable<T> command or the mappings.For<T> commands, yet if I do not I get compiler errors.
@model IEnumerable<SAP_Template.Models.Category>
@(Html.Telerik().Menu()
.Name("Menu")
.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;
})
);
})
)
I am coming to you folks as a last resort in the hope that someone may have come across this same problem in the past. I am not looking to do anything fancy right now. All I want to do is make a working example that has a bound menu to the Northwind database. Basically, I just want to extract the Telerik databound menu into a separate, MVC 3 C# (Razor) project. I am sure the problem has something to do with my namespaces, but I have been spinning my wheels for the past 2 days, getting no where...
I have attached a zip file of my C# project. Any help would be greatly appreciated...
Regards,
Peter B