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

Can PanelBar be collapsed for "SingleExpandedItem"?

1 Answer 40 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 18 Aug 2008, 12:22 PM
Hi Guys,

     I have used PanelBar in my application.
     I am not able to collapse items if I used the following setting:
         

ExpandMode = PanelbarExpandMode..SingleExpandedItem;
   
     But it works on this setting:
         
ExpandMode = PanelbarExpandMode.MultipleExpandedItems;

       is this by design?  RadPanelbar can't be collapsed if the Expandmode is SingleExpandedItem
.

Thanks for your help,

Ron. 

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 22 Aug 2008, 09:01 AM
Hi Ron,

Please note that this behavior is by default; when you have ExpandMode="SingleExpandedItem" one header item will be always expanded. The expanded item will be closed upon clicking on other header item. If you want to be able to collapse a header item while clicking on it you will have to set the ExpandMode property to MultipleExpandedItems.

Still, you can use the follwoing JS on OnClientItemClicking client event:

<script type="text/javascript">     
function CollapseItem(sender, eventArgs)  
{  
    var item = eventArgs.get_item();  
    if (item.get_expanded() == true)  
    {  
        item.set_expanded(false);  
        eventArgs.set_cancel(true);  
    }  
}         
</script>  

Best wishes,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
Ron
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or