RadPanelItem doesnt Collapse

6 posts, 0 answers
  1. Levent
    Levent avatar
    3 posts
    Member since:
    Apr 2011

    Posted 07 Jun 2011 Link to this post

    Hi,

    I have a  radpanelitem contol and its binding data without any problem.

    I inserted manually another radpanelitem into first radpanelitem but second panel doesnt collapse itselfs.

    I tried in many way to Expanded = false but It doesnt work.

    Thanks for help...

       List<LandingPage> landingPageList = new DepartmentBLL().GetLandingPage(current.ID);
                        if (landingPageList.Count != 0)
                        {
                            RadPanelItem rip = new RadPanelItem()
                            {
                                Text = "Do you know that?",
                                Value = "-5",
                                 Expanded = false
                            };

                            foreach (LandingPage lp in landingPageList)
                            {
                                RadPanelItem ripitem = new RadPanelItem();
                                ripitem.NavigateUrl = lp.PageURL;
                                ripitem.Text = lp.LinkName;
                                ripitem.Value = "-5";
                                rip.Items.Add(ripitem);
                                ripitem.Expanded = false;
                            }
                            rip.Expanded = false;
                            RadPanelBar1.Items.Insert(1, rip);
                            rip.Expanded = false;
                         }
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 10 Jun 2011 Link to this post

    Hi Levent,

    I have attached the test page where I used your code but I do not seem get the issue that you encounter. Please take a look at it and let me know if I am missing something in your scenario.

    Best wishes,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 12 Jul 2011 Link to this post

    Hi,

    I'm having the same problem. I'm using the RadPanelBar inside a Sitefinity 3.x project.
    I programmatically add items to the panelbar.

    Using the code below, the panelbar always opens fully expanded. What should I change to only open the first item?

    private void BindData() {
     
            KtbDataProvider data = new KtbDataProvider(HttpContext.Current);
            IList<KeywordGroup> keywordgroups = data.GetKeywordGroups();
            RadPanelItem rootItem;
            RadPanelItem childItem;
     
            if (keywordgroups.Count > 0) {
     
                int index = 0;
                foreach (KeywordGroup item in keywordgroups) {
     
                    rootItem = new RadPanelItem(item.Description);
                    rootItem.Style.Add(HtmlTextWriterStyle.Color, item.Color);
                     
     
                    if (item.Keywords.Count > 0) {
     
                        foreach (Keyword k in item.Keywords)
                        {
                            childItem = new RadPanelItem(k.Description);
                            rootItem.Items.Add(childItem);
                        }
                    }
     
                    if (index == 0) {
                        rootItem.Selected = true;
                        rootItem.Expanded = true;
                    } else {
                        rootItem.Selected = false;
                        rootItem.Expanded = false;
                    }
                     
                    this.pnlKeywords.Items.Add(rootItem);
                    index++;
                }
            }
        }

    This is the markup:

    <telerik:RadPanelBar ID="pnlKeywords" runat="server" Skin="Ktb" EnableEmbeddedBaseStylesheet="False"
        EnableEmbeddedSkins="False" ExpandMode="SingleExpandedItem">
    </telerik:RadPanelBar>

    Regards,
    Daniel
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 15 Jul 2011 Link to this post

    Hello Daniel,

    Try expanding the PanelBar item as described in the following help article - Working With Items Using Server-Side Code.

    Greetings,
    Kate
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Daniel Plomp
    Daniel Plomp avatar
    7 posts
    Member since:
    Jun 2012

    Posted 15 Jul 2011 Link to this post

    The problem is that the panelbar items always are expanded. I can't figure out how to collapse them...
  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 15 Jul 2011 Link to this post

    Hello Daniel,

    Thank for clarifying. Please take a look at the following forum thread where the issue is being discussed. In case this does not help I would suggest that you open a support ticket and send us a simple runnable project where we can inspect the issue locally and help you out.

    Kind regards,
    Kate
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

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