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

Expand items for one level

1 Answer 41 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
salaro
Top achievements
Rank 2
salaro asked on 30 Apr 2010, 07:52 AM

We need to expand the items for one level as default  by page load .

We have the following code snippet in order to expand the first item when page loads in C#:
protected void RadPanelBar1_DataBound(object sender, EventArgs e)
{
    RadPanelBar1.Items[0].Expanded = true;
}

Please can you give equivalent javascript code for this source.

Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Apr 2010, 08:52 AM

Hi,

Attach OnClientLoad event to RadPanelBar and try the following code for expanding the first item.

JavaScript:

 
<script type="text/javascript">  
    function OnClientLoad(sender, args) {  
        sender.get_items().getItem(0).set_expanded(true);  
    }  
</script> 

 -Shinu.

Tags
PanelBar
Asked by
salaro
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or