Collapsing Panelbar on client side.

3 posts, 1 answers
  1. Anly
    Anly avatar
    14 posts
    Member since:
    Feb 2013

    Posted 25 Feb 2013 Link to this post

    Hi,
    I have added a RadPanelBar in the master page of my web application. I want to collapse all the items on a certain page load only and so I thought of writing the code in client side page load, but my JS shows some error and is not working properly. Can anyone help me with the client side code?

    Thanks,
    Anly.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Feb 2013 Link to this post

    Hi Anly,

    Try the following JavaScript in the particular content page where you want the RadPanelBar items to be appeared as collapsed on page load.

    JavaScript:
    <script type="text/javascript">
    function pageLoad() {
        var panelbar = $find("<%= Master.FindControl("RadPanelBar1").ClientID %>");   
        for (var i = 0; i < panelbar.get_allItems().length; i++) {
            panelbar.get_allItems()[i].set_expanded(false);
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anly
    Anly avatar
    14 posts
    Member since:
    Feb 2013

    Posted 26 Feb 2013 Link to this post

    Thanks princy for your valuable time. This works fine.
Back to Top