Hi Telerik Team,
I am developing a webpart using RadTabStrip structure associated to a RadMultipage that can contain three RadPageViews.
Every single RadPageView has a set of controls grouped in a single custom class.
This structure is displayed properly on the page, but when I save data to use them in the next page, I try to access the controls in each of these pageviews but I don't find them.
In fact, the call PageView.Controls [index] gives the following error: 'SystemArgumentException index was out of range'.
Also when I perform a FindControl ("MyCustomControl") on every single multipage or on PageView for direct research of my custom control I receive as output 'null'. Now I attach my code.
ASPX
ASPX.CS
I hope you can help me.
Best regards,
Gromiko Francese
I am developing a webpart using RadTabStrip structure associated to a RadMultipage that can contain three RadPageViews.
Every single RadPageView has a set of controls grouped in a single custom class.
This structure is displayed properly on the page, but when I save data to use them in the next page, I try to access the controls in each of these pageviews but I don't find them.
In fact, the call PageView.Controls [index] gives the following error: 'SystemArgumentException index was out of range'.
Also when I perform a FindControl ("MyCustomControl") on every single multipage or on PageView for direct research of my custom control I receive as output 'null'. Now I attach my code.
ASPX
<div class="el-tabview-strip">
<rad:RadTabStrip ID="RadTabStrip1" runat="server" Orientation="VerticalLeft" SelectedIndex="0" MultiPageID="RadMultiPage1"></rad:RadTabStrip>
</div>
<div class="el-tabview-content">
<div>
<rad:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Height="416px" ></rad:RadMultiPage>
</div>
</div>ASPX.CS
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
List<String> aac = GetState();
foreach (String cc in aac)
{
//Adding View to MultiPage
Telerik.Web.UI.RadPageView view = new Telerik.Web.UI.RadPageView();
view.ID = ClientID + "radPageView" + cc.NumeroCC;
CustomControls MyCustomControl = new CustomControls();
MyCustomControl.ID = ClientID + "customContol" + cc.NumeroCC;
view.Controls.Add(MyCustomControl);
RadMultiPage1.PageViews.Add(view);
//Adding Tab to RAdstrip
Telerik.Web.UI.RadTab tab = new Telerik.Web.UI.RadTab();
tab.Text = "C/C " + cc.NumeroCC.Replace("/", " / ");
tab.CssClass = "tabsTab paddingTop17";
tab.SelectedCssClass = "tabsTab tabsTabSelected paddingTop17";
tab.PageViewID = ClientID + "radPageView" + cc.NumeroCC;
RadTabStrip1.Tabs.Add(tab);
}
}
}
public override void SaveNavigationState(Core.NavigationEventArgs e)
{
List<String> list = new List<String>();
String aac = new String();
for (int i = 0; i < RadMultiPage1.Controls.Count; i++)
{
Telerik.Web.UI.RadPageView pageView = RadMultiPage1.Controls[i] as Telerik.Web.UI.RadPageView;
CustomControls current = pageView.Controls[i] as CustomControls;
if (current == null)
return;
aac = current.GetControl(); //This Method Return the value of all control grouped in the CustomControl
list.Add(aac);
}
}I hope you can help me.
Best regards,
Gromiko Francese