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;
}
}