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

Question for Collapse ??

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

     I have to post this again, I hope some one can give me some answers.

     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; 

     Can items be collapsed if the expandMode is SingleExpandedItem? if so, How?

      

Thanks for your help,

Ron. 

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 22 Aug 2008, 09:02 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>  


Regards,
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