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
265
UltraWebTree - Load UserControl
posted

I have two panes, In my left pane, I have UltraWebTree with all nodes. When I click the node I need to load User control in the right hand pane. Can you please tell me how to load user control.

I have 3 nodes and each of them should load different usercontrol.

Any ideas

 

Thanks

Parents
No Data
Reply
  • 8736
    Suggested Answer
    posted

    Hello,

    You can achieve the described functionality using the following code:

    protected void UltraWebTree1_NodeClicked(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e)

        {

            Node selectednode = UltraWebTree1.SelectedNode;

            if (selectednode.Text=="LoadUserControl2")

            {

                UserControl testcntrl = (UserControl)Page.LoadControl("Usrcntrl2.ascx");

                Panel1.Controls.Add(testcntrl);

                Debug.WriteLine("node2 selected");

             

            }

    I have also put together a sample for you to review.

    Please let me know if you need further assistance.

    Bhadresh

    WebTreeusercontroltest.zip
Children
No Data