Oct 29, 2008, 5:23 AM
[CLOSED] Tabpanel in tabpanel from code behind
Hi
I want to have a tabpanel with tabs, and in each tab I want to add another tabpanel that also contains tabs, I want to to this from the code behind and I cat get it to work. Please have a look at the sample code.
Mikael Jürke</p>
I want to have a tabpanel with tabs, and in each tab I want to add another tabpanel that also contains tabs, I want to to this from the code behind and I cat get it to work. Please have a look at the sample code.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form2" runat="server">
<ext:ScriptManager ID="ScriptManager2" runat="server" HideInDesign="false">
</ext:ScriptManager>
<ext:TabPanel Plain="true" ID="TabPanelOuter" AutoWidth="true" AutoHeight="true" BodyBorder="true" Border="true" runat="server" >
</ext:TabPanel>
</form>
</body>
</html>
public partial class Test_Default : System.Web.UI.Page
{</p>
</p>
protected void Page_Load(object sender, EventArgs e)
{</p>
****for (int i = 0; i < 2; i++)
****{</p>
********Tab tabOuter = new Tab("tabOuter" + i, "TabOuter "+i);</p>
******* TabPanelOuter.Tabs.Add(tabOuter);</p>
</p>
********TabPanel TabPanelInner = new TabPanel();</p>
********TabPanelInner.ID = "TabPanelInner" + i;</p>
********TabPanelInner.Plain = true;</p>
********tabOuter.Controls.Add(TabPanelInner);for (int j = 0; j < 2; j++)
********{
************Tab tabInner = new Tab();
************tabInner.ID = "tabInner" +i.ToString() +"_"+ j.ToString();
************tabInner.Title = "TabInner" + i;
************tabInner.Html = "Test";
************TabPanelInner.Tabs.Add(tabInner);
********}
****}
}
}
Best regardsMikael Jürke</p>