Completed
Last Updated: 13 Mar 2024 08:49 by ADMIN
Release 2024.1.312
Al
Created on: 24 Jan 2024 15:19
Category: UI for WinForms
Type: Bug Report
0
RadCommandBar: Wrong size when the control is placed in an auto-sized user control
   
1 comment
ADMIN
Hristo
Posted on: 24 Jan 2024 16:13

Hello,

A possible workaround is to create a custom RadCommandBar and override its GetPreferredSize method:

public class MyRadCommandBar : RadCommandBar
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadCommandBar).FullName;
        }
    }

    public override Size GetPreferredSize(Size proposedSize)
    {
        if (this.Parent != null && this.Parent.AutoSize && (proposedSize.Width < 1 || proposedSize.Height < 1))
        {
            proposedSize = this.Size;
        }

        return base.GetPreferredSize(proposedSize);
    }
}

Regards,
Hristo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.