I have the following piece of code for radControls.
<telerik:RadTabStrip ID="RadTabStripControl" runat="server" MultiPageID="RadMultiPageControl" SelectedIndex="0" OnTabClick="RadTabStripControl_TabClick">
<Tabs>
<telerik:RadTab Text="Test" Value="TestReport" TabIndex="0" Selected="true" >
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPageControl" RenderSelectedPageOnly="true" runat="server" SelectedIndex="0" CssClass="TestSkin" Height="95%" >
<telerik:RadPageView ID="RadPageViewTest" TabIndex="0" runat="server" Height="95%">
<telerik:RadGrid ID="GridTest" runat="server" Height="100%" Skin="MyCustomSkin" EnableEmbeddedSkins="false" PageSize="50"
OnPageSizeChanged="GridTest_PageSizeChanged" Width="100%" OnSortCommand="GridTest_SortCommand" OnPageIndexChanged="GridTest_PageIndexChanged"
EnableLinqExpressions="false" OnNeedDataSource="GridTest_NeedDataSource" OnItemCommand="GridTest_OnItemCommand" OnItemCreated="GridTest_ItemCreated" >
</telerik:RadGrid>
</telerik:RadPageView>
and following is my backend code:
if (DtPreference.Rows.Count > 0) // getting 7 rows
{
Int16 i = 1;
foreach (DataRow dr in DtPreference.Rows)
{
if (!string.IsNullOrEmpty(dr["Test"].ToString()))
{
RadTab tabTemp = new RadTab();
tabTemp.Text = dr["Test"].ToString();
tabTemp.Value = dr["Test"].ToString();
tabTemp.TabIndex = (Int16)(i);
RadTabStripControl.Tabs.Add(tabTemp);
RadPageView pvTemp = new RadPageView();
pvTemp.ID = "RadPageView" + dr["Test"].ToString();
tabTemp.Selected = true;
pvTemp.Selected = true;
RadButton rbtn = new RadButton();
rbtn.Text = "RadPageView" + dr["Test"].ToString();
pvTemp.Controls.Add(GridTest);
RadMultiPageControl.PageViews.Add(pvTemp);
}
}
}
I can see the tabs but I m not able to see the control inside tabs.
Can someone please tell me or suggest me what I m doing wrong?
Appreciate any help.
Thanks.
Take a look here: http://demos.telerik.com/aspnet-ajax/tabstrip/examples/multipage/dynamic-pageview-creation/defaultcs.aspx. It explains programmatic creation of pageviews, adding controls in them. Scroll down to the code if you are not interested in the actual demo.