Hi,
In the code below I keep getting an error on this line when the code executes: RadPanelBar rpb = (RadPanelBar)pv.Controls[0];
The error is an unable to cast object error.
Any idea how to resolve this?
protected void RadButtonExpandAll_Click(object sender, EventArgs e)
{
int selectedIndex = RadTabStrip1.SelectedIndex;
if (selectedIndex >= 0)
{
RadPageView pv = RadMultiPage1.PageViews[selectedIndex];
RadPanelBar rpb = (RadPanelBar)pv.Controls[0]; // This is what errors //
foreach (RadPanelItem r in rpb.Items)
{
r.Expanded = true;
}
}
}
Thanks,
Kevin
In the code below I keep getting an error on this line when the code executes: RadPanelBar rpb = (RadPanelBar)pv.Controls[0];
The error is an unable to cast object error.
Any idea how to resolve this?
protected void RadButtonExpandAll_Click(object sender, EventArgs e)
{
int selectedIndex = RadTabStrip1.SelectedIndex;
if (selectedIndex >= 0)
{
RadPageView pv = RadMultiPage1.PageViews[selectedIndex];
RadPanelBar rpb = (RadPanelBar)pv.Controls[0]; // This is what errors //
foreach (RadPanelItem r in rpb.Items)
{
r.Expanded = true;
}
}
}
Thanks,
Kevin