Hello,
I would like the RadPageViewPage to automatically resize itself to its contents when the contents is changed.
It appears that when the contents of the RadPageViewPage is changed its height stays the same. fig1 shows the height before content is modified fig2 shows the height after content is modified(pressing ‘Next’ button), fig3 shows the height after one of the RadPageViewPage tabs is clicked, clicking 'Next' after that keeps the same height. It appears that if a tab is clicked the RadPageView resizes itself. So how can I make the RadPageView resize itself to its content programmatically.
Code to reproduce:
public Form1()
{
InitializeComponent();
var spa = new SplitContainer()
{
Orientation = Orientation.Horizontal,
Dock = DockStyle.Fill
};
spa.FixedPanel = FixedPanel.Panel2;
spa.SplitterDistance =300;
this.Controls.Add(spa);
var rpv = new RadPageView()
{
Dock = DockStyle.Fill,
ViewMode = PageViewMode.ExplorerBar
};
((RadPageViewExplorerBarElement)rpv.GetChildAt(0)).ContentSizeMode = ExplorerBarContentSizeMode.AutoSizeToBestFit;
var pag = Enumerable.Range(0, 3).Select(a =>
new RadPageViewPage() { Name = "Page" + a, Text = "Page" + a, IsContentVisible = true }
);
rpv.Controls.AddRange(pag.ToArray());
spa.Panel1.Controls.Add(rpv);
var cn = 0;
var b1 = new Button() { Text = "Next" };
b1.Click += (o, e) =>
{
var cpag = rpv.Controls.Cast<
RadPageViewPage
>().ToList();
cpag.ForEach(a => a.Controls.Clear());
cpag.ForEach(a => a.Controls.Add(new RadLabel() { Text = (cn++) + "\na\nb\nc\nd\ne\n" }));
};
spa.Panel2.Controls.Add(b1);
}
}
Any help would be appreciated,