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

Requesting Dynamic Menu Code Example

1 Answer 179 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 27 Aug 2014, 02:11 PM
Hello,

Does anyone have a working sample or know of complete documentation that shows how to create a dynamic menu that is built upon hierarchy settings that are retrieved from SQL Server, utilizing C# and MVC?

Thank You in Advance!

Robert

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Aug 2014, 06:51 AM
Hello Robert,

Here they are:

Documentation:

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/menu/overview#bind-kendo-menu-to-a-hierarchical-model

Demo:

(for a more in-depth inspection, check the "Model Binding" Menu example in the offline ASP.NET MVC demo site, which is shipped with the UI for ASP.NET MVC package)

@model IEnumerable<Kendo.Mvc.Examples.Models.Category>
 
@(Html.Kendo().Menu()
      .Name("Menu")
      .BindTo(Model, mappings =>
      {
            mappings.For<Kendo.Mvc.Examples.Models.Category>(binding => binding
                    .ItemDataBound((item, category) =>
                    {
                        item.Text = category.CategoryName;
                    })
                    .Children(category => category.Products));
            mappings.For<Kendo.Mvc.Examples.Models.Product>(binding => binding
                    .ItemDataBound((item, product) =>
                    {
                        item.Text = product.ProductName;
                    }));
      })
)


Regards,
Dimo
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Menu
Asked by
Robert
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or