Create a dinamically treeview

2 posts, 1 answers
  1. Bruno
    Bruno avatar
    20 posts
    Member since:
    Feb 2012

    Posted 05 Mar 2012 Link to this post

    I wanna create the treeview data, and looks like this.

                 - child1
                 - child2
                - child3
                - child4

    Until now i dont found any stuff about that, and i facing some problems to do that.
    Does anyone know how can i do that?
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Mar 2012 Link to this post


    Try the following code.
    protected void Page_Load(object sender, EventArgs e)
      RadTreeView RadTreeView1 = new RadTreeView();
      RadTreeNode Past = new RadTreeNode();
      Past.Text = "Past";
      RadTreeNode Example1 = new RadTreeNode();
      Example1.Text = "Example1";
      RadTreeNode child1 = new RadTreeNode();
      child1.Text = "child1";
      RadTreeNode child2 = new RadTreeNode();
      child2.Text = "child2";
      RadTreeNode Example2 = new RadTreeNode();
      Example2.Text = "Example2";
      RadTreeNode child3 = new RadTreeNode();
      child3.Text = "child3";
      RadTreeNode child4 = new RadTreeNode();
      child4.Text = "child4";

Back to Top