Expand items for one level

2 posts, 0 answers
  1. salaro
    salaro avatar
    10 posts
    Member since:
    Mar 2007

    Posted 30 Apr 2010 Link to this post

    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

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Apr 2010 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top