RadPanelBar Collapse All items is not working

3 posts, 0 answers
  1. Amjath
    Amjath avatar
    16 posts
    Member since:
    Mar 2016

    Posted 07 Jun Link to this post

    Hello All,

    I want the RadPanelBar to load by collapsing all the items, if the user need to see and they can expand, but collapse all is not happening at all.

    In my case my datasource will be like this

    Item1

         --Item1.1

         --Item1.2

     

    while loading the page I want to see only the Item1 alone

    Mark up code:

    <telerik:RadPanelBar ID="rdPnlOrgDetail" RenderMode="Lightweight" OnDataBound="rdPnlOrgDetail_DataBound" runat="server" OnPreRender="rdPnlOrgDetail_PreRender" AllowCollapseAllItems="true" ExpandMode="SingleExpandedItem" OnClientLoad="collapseAll">
        
    </telerik:RadPanelBar>

     

    Dynamically adding the Items 

    rdPnlOrgDetail.CollapseAllItems();
               
                var source= getSource();

                rdPnlOrgDetail.Items.Clear();
                RadPanelItem orgItems = new RadPanelItem();
                orgItems.Text = string.Format("{0} : {1}", orgChart.First().OrganisationScope.Scope, orgChart.First().Name.ToString());
                orgItems.Expanded = false;

                for (int i = 1; i < orgChart.Count; i++)
                {
                    RadPanelItem orgItem = new RadPanelItem(string.Format("{0} : {1}", orgChart[i].OrganisationScope.Scope, orgChart[i].Name.ToString()));
                    orgItem.Expanded = false;
                    orgItems.Items.Add(orgItem);
                    orgItems.Expanded = false;
                }
                orgItems.Expanded = false;
                rdPnlOrgDetail.Items.Add(orgItems);
                rdPnlOrgDetail.CollapseAllItems();

     

    please do the needful.

     

    With Thanks 

    Amjath

  2. Peter Milchev
    Admin
    Peter Milchev avatar
    139 posts

    Posted 09 Jun Link to this post

    Hello Amjath,

    In the attachment, you will find the sample page, that we used to recreate the described scenario. You could use it as a reference. 

    Regards,
    Peter Milchev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Amjath
    Amjath avatar
    16 posts
    Member since:
    Mar 2016

    Posted 10 Jun in reply to Peter Milchev Link to this post

    Hello Peter Milchev,

    Still the collpase was not happening in my project.

    the radpanelbar is in the usercontrol and that control was referred in the page, will this be a problem.

    With Thanks

    Amjath

Back to Top