Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Looking to use the web tree to create a webtab server side with ajax
posted

Listed below is my tree,  I am trying to link the tree such that when a node is clicked in the tree, the server creates a new web tab(loaded with an acsx control) and populates a new Tab into the WebTab.  All done without any postbacks...The code behind for the click event does not seem to occur at all when using breakpoints and the debugger.

 

<ig:WebDataTree ID="WebDataTree9" runat="server" DataSourceID="TreeDataSource" InitialExpandDepth="1"
                                        Style="float: left" EnableConnectorLines="True" StyleSetName="Office2007Blue"
                                        EnableAjax="true" EnableHotTracking="true" SelectionType="Single" onnodeclick="WebDataTree9_NodeClick" Height="413px"
                                        Width="285px" AutoPostBackFlags-SelectionChanged="Async">                                       
                                        <DataBindings>
                                            <ig:DataTreeNodeBinding DataMember="Item" TextField="Text" ValueField="Text" ImageUrlField="ImageUrl" />
                                        </DataBindings>
                                    </ig:WebDataTree>

 

<ig:WebTab ID="WebTab1" runat="server" Height="800px" Width="860px" TabOrientation="Horizontal" TabLocation="TopLeft" SelectedIndex="0" EnableActivation="true" StyleSetName="Office2007Blue"> 
            <AddNewTabItem Enabled="true" TextForNewTab="Untitled" EnableTextEditingOnDoubleClick="true" /> 
            <CloseButton Enabled="true" />
            <PostBackOptions EnableLoadOnDemandUrl="true" />                   

            <Tabs>
                <ig:ContentTabItem runat="server" Text="Tab 1">
                    <Template>
                        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                    </Template>                   
                </ig:ContentTabItem>
            </Tabs>
        </ig:WebTab>

 

C#

protected void WebDataTree9_NodeClick(object sender, DataTreeNodeClickEventArgs e)
        {
            ContentTabItem Tab = new ContentTabItem();
            //Tab.ContentUrl = "~/Customer.acsx";
            Tab.ContentUrl = "http://www.google.com";
            WebTab1.Tabs.Add(Tab);
        }

Parents
No Data
Reply
  • 33839
    posted

    Hey,

    So the problem is that when you do the async autopostback for the WebDataTree, no information is carried back from the server for the WebTab.  One way to get no full postback would be to have the Autopostbac as On for the datatree, but wrap the tree and web tab in an update panel.

    Another possible solution would be to add the tab to the WebTab on the client using JavaScript.

    Hope this helps,

    David Young

Children
No Data