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

Binding to model for submenu

0 Answers 31 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alden
Top achievements
Rank 1
Alden asked on 18 Sep 2011, 08:05 PM
Hi, I have a menu control that is correctly displaying my menu, but I'm stuck on a problem.  See the following view code.
  @{ Html.Telerik().Menu()
                .Name("Menu")
                .Items(menu =>
                {
                    menu.Add().Text("Dashboard").Action("Index", "Tasks");
                    menu.Add().Text("People").Action("Index", "People");
                    menu.Add().Text("Projects").Action("Index", "Projects").Items(?????)
                   ........
                } )
                .Render();
}
Under the projects menu heading, I want to list the names of the projects as submenu items the logged in user controls.  That is, I need to bind this submenu to a model that returns the current list of projects owned by the logged in user.

How do I do this?  I have only found examples of binding the whole menu to a model.  Can I do this with a content template, somehow?  Or is there way to bind only a submenu to a model?

Thanks in advance!
Tags
Menu
Asked by
Alden
Top achievements
Rank 1
Share this question
or