When RadPanel is set to AutoSize, it should update its size automatically when changing the visibility of some control inside it.
Workaround:
public class CustomRadPanel : RadPanel
{
public override string ThemeClassName
{
get
{
return typeof(RadPanel).FullName;
}
set
{
base.ThemeClassName = value;
}
}
protected override void OnLayout(LayoutEventArgs e)
{
base.OnLayout(e);
int maxHeight = 0;
foreach (Control control in this.Controls)
{
if (control.Visible)
{
maxHeight = Math.Max(control.Height, maxHeight);
}
}
this.AutoSize = false;
this.Height = maxHeight;
}
}
Hello,
This behavior was first reported more than 10 years ago, and we haven’t seen significant demand or follow-up from the community since then. As a result, we currently plan to prioritize improvements with broader impact and greater demand.
I marked this thread as "Declined". If this limitation is still affecting your scenario, please share additional context or use cases.
Thank you for taking the time to share your feedback!
Regards,
Dinko | Tech Support Engineer
Progress Telerik