This is a migrated thread and some comments may be shown as answers.

RadPanelItem doesnt Collapse

5 Answers 68 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Levent
Top achievements
Rank 1
Levent asked on 07 Jun 2011, 08:27 AM
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;
                     }

5 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 10 Jun 2011, 04:06 PM
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.

0
Daniel Plomp
Top achievements
Rank 2
answered on 12 Jul 2011, 08:11 AM
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
0
Kate
Telerik team
answered on 15 Jul 2011, 08:28 AM
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!

0
Daniel Plomp
Top achievements
Rank 2
answered on 15 Jul 2011, 08:30 AM
The problem is that the panelbar items always are expanded. I can't figure out how to collapse them...
0
Kate
Telerik team
answered on 15 Jul 2011, 12:51 PM
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!

Tags
PanelBar
Asked by
Levent
Top achievements
Rank 1
Answers by
Kate
Telerik team
Daniel Plomp
Top achievements
Rank 2
Daniel Plomp
Top achievements
Rank 2
Share this question
or