how to set radpanelbar expand first item when clicking button

3 posts, 0 answers
  1. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 11 Jul 2011 Link to this post

    Hi,

    I am using radpanelbar as user control(like ascx page). i am using that user control another aspx page. it is working fine. but i want expand first item when clicked button in client side. is that possible?. i can get radpanel bar in client side when clicking button. but i am not able to get radpanel item in that page. please let me know how to i set expand item manually in client side,

    I attached code let know correct way for set manually expand item for user control radpanelbar.

    var panelbar = $find('ctl00_ContentPlaceHolder1_ucInjuryeval_rpbInjuryEval'); 

    var item = panelBar.findItemByText(text);
        if (item) {
    item.expand();
    }

    i am not able to get (item). please let know how to i get.

    Thanks in advance,
    Dhamu.
  2. KwangTae
    KwangTae avatar
    9 posts
    Member since:
    Nov 2011

    Posted 18 Jan 2012 Link to this post

    try like below...

    panelBar.Items[0].Expanded = true;


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Jan 2012 Link to this post

    Hello,

    Try the following javascript.
    JS:
    <script type="text/javascript">
     function OnClientClick()
      {
        var PanelBar1= $find("<%= PanelBar1.ClientID %>")
        PanelBar1.get_items().getItem(0).set_expanded(true);
      }
    </script>

    Thanks,
    Princy.
Back to Top