How to Bind the Object List to Menu Controller

2 posts, 0 answers
  1. Erandika
    Erandika avatar
    1 posts
    Member since:
    Jun 2012

    Posted 04 Feb 2014 Link to this post


    I want to bind the object list (object contain the two properties called Name and ID) and when i select Menu Item I want to get post request which is contain the selected object Name and ID. Is there anyway to do this with MVC menu control?

  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 07 Feb 2014 Link to this post

    Hello Erandika,

    When you bind your Menu to a .net collection. You can construct the URL and add parameters to it based on the collection that you bind to.

    Here is a small example I made by modifying one of our examples.

    @model IEnumerable<Kendo.Mvc.Examples.Models.Category>
          .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;
                            item.Url = "http://" + product.CompanySite+ "?someParam=foo";

    Kind Regards,
    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top