Completed
Last Updated: 16 Sep 2015 08:05 by ADMIN
ADMIN
Stefan
Created on: 18 Aug 2015 10:31
Category: Panel, CollapsiblePanel, Label, GroupBox
Type: Bug Report
0
FIX. RadCollapsiblePanel - the control layout breaks when hosted in RadLayoutControl and the collapsible panel is collapsed
To reproduce: add RadCollapsiblePanel to RadLayoutControl, run it and collapse RadCollapsiblePanel => the expand/collapse button will get hidden

Workaround:

 public SampleForm()
        {
            InitializeComponent();

            radCollapsiblePanel1.AutoSize = false;
            radCollapsiblePanel1.Collapsed += radCollapsiblePanel1_Collapsed;
            radCollapsiblePanel1.Expanding += radCollapsiblePanel1_Expanding;
            radCollapsiblePanel1.Expanded += radCollapsiblePanel1_Expanded;

        }

        void radCollapsiblePanel1_Expanded(object sender, EventArgs e)
        {
            UpdateLayout();
        }

        private void UpdateLayout()
        {
            radLayoutControl1.RootElement.InvalidateMeasure(true);
            radLayoutControl1.RootElement.UpdateLayout();

            radCollapsiblePanel1.RootElement.InvalidateMeasure(true);
            radCollapsiblePanel1.RootElement.UpdateLayout();
        }

        void radCollapsiblePanel1_Expanding(object sender, CancelEventArgs e)
        {

            radLayoutControl1.FindItemByControl(radCollapsiblePanel1).MaxSize = new Size(0, 0);
            radLayoutControl1.FindItemByControl(radCollapsiblePanel1).MaxSize = new Size(0, 0);

            UpdateLayout();
        }

        void radCollapsiblePanel1_Collapsed(object sender, EventArgs e)
        {
            radLayoutControl1.FindItemByControl(radCollapsiblePanel1).MaxSize = new Size(31, 0);
            radLayoutControl1.FindItemByControl(radCollapsiblePanel1).MinSize = new Size(31, 0);

            UpdateLayout();
        }
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments