You can add controls to the treeview easily by doing a controls.add at the
appropriate tab. Here is some code to guide you:
Microsoft.Web.UI.WebControls.ToolbarButton ti = new
Microsoft.Web.UI.WebControls.ToolbarButton();
ti.ImageUrl = "icon_excel.gif";
ti.ID = "Excel";
ti.ButtonClick += new
Microsoft.Web.UI.WebControls.ToolbarItemEventHandler(ti_ButtonClick);
Tools.Items.AddAt(4,ti);
ti = null;
--
-----------
Got TidBits?
Get it here:
www.networkip.net/tidbits [quoted text, click to view] "Brian Watkins" <raistlin19@aol.com> wrote in message
news:uAFa4DEsDHA.3420@tk2msftngp13.phx.gbl...
> I am trying to dynamically add tabs to my tabstrip control and then build
a
> different treecontrol for each tab on my tab control.
> Basically the Tabstrip control would have n number of tabs/pageviews and
> each pageview would have its own treeview.
> Any suggestions on how I could tweak the code below to make this whole
thing
> dynamic? Thanks in advance
>
> Here is how I statically create the tabstrip with one tab and one treeview
>
> <%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
> <%@ Register TagPrefix="mytab" Namespace="Microsoft.Web.UI.WebControls"
> Assembly="Microsoft.Web.UI.WebControls %>
> <%@ register TagPrefix="mytree" Namespace="Microsoft.Web.UI.WebControls"
> Assembly ="Microsoft.Web.UI.WebControls" %>
>
> <script runat="server" >
>
> Sub Page_Load(sender as Object, e As EventArgs)
>
> IF Not IsPostBack Then
> Call FillTreeView()
>
> End IF
>
> End Sub
>
> Sub FillTreeView()
>
> 'fill treeview code here
>
> End Sub
>
> <html>
> <head>
> <body>
> <form id=f1 runat="server">
>
> <mytab:TabStrip id="tsDocuments" runat="server" TargetID="mpHoriz">
> <mytab:Tab Text="Tab1" />
> <mytab:TabSeparator />
> </mytab:TabStrip>
> <mytab:MultiPage id="mpHoriz" runat="server">
>
> <mytab:PageView>
> <table>
> <tr>
> <td>
> <MYTREE:TREEVIEW ID="tvwDirectory" RUNAT="server"
CHILDTYPE="Directory"
> <MYTREE:TREENODETYPE
> TYPE="Directory"
> CHILDTYPE="Files, Folders"
> />
> <MYTREE:TREENODETYPE
> TYPE="Folders"
> CHILDTYPE="Files, Folders"
> />
> <MYTREE:TREENODETYPE
> TYPE="Files"
> />
> </MYTREE:TREEVIEW>
> </td>
> </tr>
> </table>
> </mytab:PageView>
>
> </mytab:MultiPage>
>
> </FORM>
> </body>
> </html>
>
>