Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > PanelBar > Panelbar in grid column is wired up to menu in other column - how?

Not answered Panelbar in grid column is wired up to menu in other column - how?

Feed from this thread
  • Rob avatar

    Posted on Nov 29, 2011 (permalink)

    Hi,

    I have a Telerik MVC grid that has a column with a menu in it as well as a column with a panel bar in it.  I recently added the panel bar to one of the columns and now when I click on items in the panel bar, the "onSelect" javascript function for the menu is executing -- and it is executing once for each row (for each panel bar).  How does this happen?

    Below is the code that defines both of the conflicting columns and I don't see how the menu jscript function is being bound to the panelbar.  Any insight is appreciated.

    Thanks,

    Rob

    --

    Here is how I defined my menu:
    columns.Bound(o => o.Status)
        .ClientTemplate(Html.Telerik().Menu().Name("menuOrderStatus_<#=OrderId#>")
            .Items(menu => menu.Add().Text("<#=Status#>").HtmlAttributes(new { @style = "width:115px;", @class = "orderlist-current-order-status" })
                .Items(submenu =>
                {
                    IList<string> orderStatuses = ViewData["AllOrderStatuses"] as IList<string>;
                    foreach (string status in orderStatuses)
                        submenu.Add().Text(status).HtmlAttributes(new { @style = "width:115px;" });
                }))
         .ClientEvents(events => events.OnSelect("menuSelectOrderStatus").OnOpen("menuOpenOrderStatus").OnClose("menuClosed"))
         .Effects(fx =>
             fx.Expand(animation => animation.CloseDuration(AnimationDuration.Fast).OpenDuration(AnimationDuration.Fast))
                 .OpenDuration(AnimationDuration.Fast).CloseDuration(AnimationDuration.Fast))
         .ToHtmlString());

    Here is how I defined my panelbar: 
    columns.Bound(o => o.HasPhone)
    .Title("Phone")
    .ClientTemplate(Html.Telerik().PanelBar()
    .Name("panelPhone_<#=OrderId#>")
    .SelectedIndex(0)
    .Items(item => { item.Add()
            .Text("Phone")
            .Expanded(false)
            .ImageUrl("~/images/icons/16/phone.png")
            .ImageHtmlAttributes(new { alt = "Patient Phone Numbers" })
            .Items(subItem =>
            {
                subItem.Add().Text("(h) <#=PatientHomePhone#>");
                subItem.Add().Text("(c) <#=PatientCellPhone#>");
                subItem.Add().Text("(w) <#=PatientWorkPhone#>");
            });
    }).ToHtmlString());

    Reply

  • Petur Subev Petur Subev admin's avatar

    Posted on Dec 2, 2011 (permalink)

    Hello Rob,

    I implemented the scenario you described but I did not encounter the same behavior. Could you please check if I missed something in the sample I attached? If so please modify the project and send it back so we can check it.

    Kind regards,
    Petur Subev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now

    Reply

  • Rob avatar

    Posted on Dec 2, 2011 (permalink)

    Hi Petur,

    Thanks for the assistance.  Would you be able to send me the project in VS 2008 format?  Unfortunately, I don't have 2010 at the moment.

    Thanks,

    Rob

    Reply

  • Petur Subev Petur Subev admin's avatar

    Posted on Dec 5, 2011 (permalink)

    Hi Rob,

    Here is the converted VS2008 solution.

    Greetings,
    Petur Subev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > PanelBar > Panelbar in grid column is wired up to menu in other column - how?
Related resources for "Panelbar in grid column is wired up to menu in other column - how?"

ASP.NET MVC PanelBar Features  |  Documentation  |  Demos  |  Telerik TV ]