Completed
Last Updated: 13 Apr 2023 08:25 by ADMIN
Release R2 2023 (LIB 2023.1.413)
Youssef
Created on: 09 Mar 2023 12:20
Category: DropDownList
Type: Bug Report
1
RadDropDownList: Arrow button disappears on RadDropDownList and RadSpinEditor inside TableLayoutPanel when minimizing and restoring to normal state

Run the attached project and minimize the form. Then, restore to its normal state:

Initial state:

After minimizing the form and restoring to its normal state, the arrow for RadDropDownList seems clipped:

 

Attached Files:
2 comments
ADMIN
Todor
Posted on: 04 Apr 2023 04:23

Hello,

I would like to follow up with additional information about the cause of this unexpected behavior.

The Microsoft TableLayoutPanel control has strange, even weird behavior when the form is minimized. The TableLayoutPanel passes 0 and/or 1 as width and/or height to the inner control in the GetPreferredSize and SetBoundsCore methods during the layout. This breaks the core layout of the Telerik UI for WinForms editor controls, which results in a shrunk control or hidden elements. We had to take action because we are widely advertising the TableLayoutPanel for high DPI scenarios, so a few years ago we introduced code that prevents setting such small widths or heights to the control. 

In the sample project, the AutoSize property of the editor controls is set to false. Telerik editor controls are almost always used in AutoSize scenarios, so we haven't covered this scenario in the previous fix. Now, we will extend the fix to cover the case when the editor is AutoSize and this will fix the problem on your side.

I believe that it would have a positive impact in the controls hosted in a TableLayoutPanel.

Regards,
Todor Vyagov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 09 Mar 2023 12:33

Hi, Youssef,

Thank you for bringing this to our attention. Currently, due to the specificity of the issue, the possible solution that I can suggest is to force updating the layout once the form is restored to its normal state:

        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case NativeMethods.WM_SYSCOMMAND:
                    int command = m.WParam.ToInt32() & 0xfff0;
                    if (command == NativeMethods.SC_RESTORE)
                    {
                        this.comboBox1.DropDownListElement.InvalidateMeasure(true);
                        this.comboBox1.DropDownListElement.UpdateLayout();
                        this.numericUpDown1.SpinElement.InvalidateMeasure(true);
                        this.numericUpDown1.SpinElement.UpdateLayout();
                    }
                    else if (command == NativeMethods.SC_MINIMIZE)
                    {
                        // Do your action
                    }

                    break;
            }
            base.WndProc(ref m);
        }

Make sure that you cast your vote for the item in order to increase its priority. Click the Follow button in order to get notified once any status changes occur. Please excuse us for the inconvenience caused. We will do our best to introduce an appropriate fix accordingly. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.