Completed
Last Updated: 18 Jun 2014 09:53 by Sergey
ADMIN
George
Created on: 15 Apr 2014 13:49
Category:
Type: Bug Report
0
FIX. RadCollapsiblePanel - setting the IsExpanded property at design time will result in the inner panel to hide the header
To reproduce:

Add a RadCollapsiblePanel to a form and set its IsExpanded property using the property grid at design time. Start the application and you will notice that the inner container is hiding the header and makes it unusable.

Workaround:

Use the following class, by passing it all your forms which have a RadCollapsiblePanel it will hide the inner container when each loads:



public class RadCollapsiblePanelIsExpandedFixer
{
    private Dictionary<Form, List<RadCollapsiblePanel>> panels = new Dictionary<Form, List<RadCollapsiblePanel>>();


    public RadCollapsiblePanelIsExpandedFixer(params Form[] forms)
    {
        foreach (Form form in forms)
        {
            foreach (Control control in form.Controls)
            {
                RadCollapsiblePanel panel = control as RadCollapsiblePanel;
                if (panel != null)
                {
                    if (!panels.ContainsKey(form))
                    {
                        panels[form] = new List<RadCollapsiblePanel>();
                    }


                    panels[form].Add(panel);
                    form.Load += form_Load;
                }
            }
        }
    }


    void form_Load(object sender, EventArgs e)
    {
        Form loadedForm = sender as Form;
        foreach (RadCollapsiblePanel panel in panels[loadedForm])
        {
            panel.ControlsContainer.Size = Size.Empty;
        }


        loadedForm.Load -= form_Load;
        panels.Remove(loadedForm);
    }
}

1 comment
Sergey
Posted on: 18 Jun 2014 09:53
Sorry, the provided solution - fix does not resolve the issue. Yes panel header shows up proper but on button click panel changes a location and size.