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

[Solved] how to prevent the panel bar from collapsing/ always keep as expanded

3 Answers 143 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Narayanarao
Top achievements
Rank 1
Narayanarao asked on 23 Jan 2012, 11:49 AM
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

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 23 Jan 2012, 12:30 PM
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
0
Narayanarao
Top achievements
Rank 1
answered on 23 Jan 2012, 01:24 PM
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
0
Petur Subev
Telerik team
answered on 23 Jan 2012, 01:58 PM
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
Tags
PanelBar
Asked by
Narayanarao
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Narayanarao
Top achievements
Rank 1
Share this question
or