ASP.NET 3.5 and above only

ASP.NET TreeView - Unlimited levels

Virtually unlimited number of nested levels!

  • level 0
    • level 1
      • level 2
        • level 3
          • level 4
            • level 5
              • level 6
                • level 7
                  • level 8
                    • level 9
                      • level 10
                        • level 11
                          • level 12
                            • level 13
                              • level 14
                                • level 15
                                  • level 16
                                    • level 17
                                      • level 18
                                        • level 19
                                          • level 20
                                            • level 21
                                              • level 22
                                                • level 23
                                                  • level 24
                                                    • level 25
                                                      • level 26
                                                        • level 27
                                                          • item 27
                                                        • item 26
                                                      • item 25
                                                    • item 24
                                                  • item 23
                                                • item 22
                                              • item 21
                                            • item 20
                                          • item 19
                                        • item 18
                                      • item 17
                                    • item 16
                                  • item 15
                                • item 14
                              • item 13
                            • item 12
                          • item 11
                        • item 10
                      • item 9
                    • item 8
                  • item 7
                • item 6
              • item 5
            • item 4
          • item 3
        • item 2
      • item 1
    • item 0
[ASPX]

<obout:Tree ID="OboutTree" runat="server" ClientObjectID="_OboutTree" EnableViewState="False" >
            
[C#]

void Page_load(object sender, EventArgs e)
{
    this.OboutTree.Nodes.Add(AddNode(0, 27));
}
protected Obout.Ajax.UI.TreeView.Node AddNode(int level, int max)
{
    Obout.Ajax.UI.TreeView.Node node = new Obout.Ajax.UI.TreeView.Node();
    node.Text = string.Format("{0} {1}", "level", level.ToString());
    node.Expanded = true;
    if (level < max)
    {
        node.ChildNodes.Add(AddNode(level+1, max));
    }
    Obout.Ajax.UI.TreeView.Node item = new Obout.Ajax.UI.TreeView.Node();
    item.Text = string.Format("{0} {1}", "item", level.ToString());
    node.ChildNodes.Add(item);
    return node;
}
            
[VB]

Private Sub Page_load(sender As Object, e As EventArgs)
    Me.OboutTree.Nodes.Add(AddNode(0, 27))
End Sub
Protected Function AddNode(level As Integer, max As Integer) As Obout.Ajax.UI.TreeView.Node
    Dim node As New Obout.Ajax.UI.TreeView.Node()
    node.Text = String.Format("{0} {1}", "level", level.ToString())
    node.Expanded = True
    If level < max Then
        node.ChildNodes.Add(AddNode(level + 1, max))
    End If
    Dim item As New Obout.Ajax.UI.TreeView.Node()
    item.Text = String.Format("{0} {1}", "item", level.ToString())
    node.ChildNodes.Add(item)
    Return node
End Function
            

"I am very very impressed, happy, satisfied and grateful. Again you have my sincere thanks!"

Cary Abramoff
The Bank of New York Mellon

Random testimonial   All testimonials