Completed
Last Updated: 13 Jun 2014 16:20 by ADMIN
ADMIN
George
Created on: 29 May 2014 11:32
Category:
Type: Bug Report
0
FIX. RadCollapsiblePanel - Anchoring a control to Top and Right changes its location when the panel expands
To reproduce:

Add a RadCollapsiblePanel to a form and add a RadCheckBox inside. Set its Anchor property to be Top and Right. Collapse the RadCollapsiblePanel and expand it. You will see that the checkbox will either move, most of the times out of the visible part of the panel.



Workaround:

Use the following custom classes:

class MyCollapsiblePanel : RadCollapsiblePanel
{
    protected override RadCollapsiblePanelElement CreateCollapsiblePanelElement()
    {
        return new MyCollapsiblePanelElement(this);
    }


    public override string ThemeClassName
    {
        get
        {
            return typeof(RadCollapsiblePanel).FullName;
        }
        set
        {
        }
    }
}


class MyCollapsiblePanelElement : RadCollapsiblePanelElement
{
    public MyCollapsiblePanelElement(RadCollapsiblePanel ownerControl)
        : base(ownerControl)
    {
    }


    protected override void ExecuteCollapseFinalizations()
    {
        base.ExecuteCollapseFinalizations();


        if (this.AnimationType == CollapsiblePanelAnimationType.Reveal)
        {
            RadCollapsiblePanel panel = this.ElementTree.Control as RadCollapsiblePanel;


            foreach (Control control in panel.PanelContainer.Controls)
            {
                control.ResumeLayout(false);
            }
        }
    }


    protected override void ExecuteCollapsePreparations()
    {
        base.ExecuteCollapsePreparations();


        if (this.AnimationType == CollapsiblePanelAnimationType.Reveal)
        {
            RadCollapsiblePanel panel = this.ElementTree.Control as RadCollapsiblePanel;
            panel.ControlsContainer.ResumeChildControlsLayout();


            foreach (Control control in panel.PanelContainer.Controls)
            {
                control.SuspendLayout();
            }
        }
    }


    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadCollapsiblePanelElement);
        }
    }
}



0 comments