Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > PanelBar > how to prevent the panel bar from collapsing/ always keep as expanded

Not answered how to prevent the panel bar from collapsing/ always keep as expanded

Feed from this thread
  • Narayanarao avatar

    Posted on Jan 23, 2012 (permalink)

    Hi telerik team,

    I am using a panel bar in my code and wish to have it expanded on load and always and prevent it from collapsing when clicked at header, any thoughts please ?

    thanks,
    Anand

    Reply

  • Petur Subev Petur Subev admin's avatar

    Posted on Jan 23, 2012 (permalink)

    Hello Narayanarao,


    Generally speaking to achieve this you should:
    1. Initially expand each of the panels. You can use the ItemAction method
      .ItemAction(item=>item.Expanded=true)
    2. Subscribe a function to the OnCollapse event and call the preventDefault() method exposed by the argument parameter.


    All the best,
    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

  • Narayanarao avatar

    Posted on Jan 23, 2012 (permalink)

    Well I just tried your suggestion, it fixes the collapse problem. But then it is breaking the telerik combobox ! It prevents the telerik combo box from expanding. i.e. i click at the combobox arrow nothing happens . I just remove the "
    .ClientEvents(events => events.OnCollapse("preventCollapseOfPanel()"))"
    
    and it works good. the script is as below
    
    
    function preventCollapseOfPanel(e){
                        e.preventDefault();
                        }
    please suggest . Thanks, Anand

    Reply

  • Petur Subev Petur Subev admin's avatar

    Posted on Jan 23, 2012 (permalink)

    Hello again Narayanarao,

    When you declare the function handling the event you need to pass only the name of the function without the brackets.
    i.e.
    .ClientEvents(events => events.OnCollapse("preventCollapseOfPanel"))



    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 > how to prevent the panel bar from collapsing/ always keep as expanded
Related resources for "how to prevent the panel bar from collapsing/ always keep as expanded"

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