19.04.2013 Views

IntegralUI TreeListView User Guide - Lidor Systems

IntegralUI TreeListView User Guide - Lidor Systems

IntegralUI TreeListView User Guide - Lidor Systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

node = New <strong>TreeListView</strong>Node("Node " & i.ToString())<br />

' Create subitems for this node<br />

CreateSubItems(node, i.ToString())<br />

' Create child nodes for this node<br />

CreateSubNodes(node, 0, i.ToString())<br />

Me.treeListView1.Nodes.Add(node)<br />

Next<br />

' Resume the layout logic for the <strong>TreeListView</strong> control<br />

Me.<strong>TreeListView</strong>1.ResumeUpdate()<br />

End Sub<br />

Private Sub CreateSubItems(ByVal parentNode As <strong>TreeListView</strong>Node, ByVal sufix As<br />

String)<br />

' Create subitems for specified node<br />

Dim subItem As <strong>TreeListView</strong>SubItem = Nothing<br />

For j As Integer = 0 To Me.treeListView1.Columns.Count - 1<br />

subItem = New <strong>TreeListView</strong>SubItem(("Item " & sufix) + j.ToString())<br />

parentNode.SubItems.Add(subItem)<br />

Next<br />

End Sub<br />

Private Sub CreateSubNodes(ByVal parentNode As <strong>TreeListView</strong>Node, ByVal level As<br />

Integer, ByVal sufix As String)<br />

' In this example only two levels in hierarchy are allowed<br />

If level = 2 Then<br />

Exit Sub<br />

Else<br />

' Create child nodes for specified node<br />

Dim node As <strong>TreeListView</strong>Node = Nothing<br />

For i As Integer = 0 To 1<br />

node = New <strong>TreeListView</strong>Node(("Node " & sufix) + i.ToString())<br />

' Create subitems for this node<br />

CreateSubItems(node, sufix + i.ToString())<br />

' Create child nodes for this node<br />

CreateSubNodes(node, level + 1, sufix + i.ToString())<br />

parentNode.Nodes.Add(node)<br />

Next<br />

End If<br />

End Sub<br />

[C#]<br />

using <strong>Lidor</strong><strong>Systems</strong>.<strong>IntegralUI</strong>.Lists;<br />

. . .<br />

// Assuming that <strong>TreeListView</strong> control exist<br />

private void InitList()<br />

{<br />

// Suspend the layout logic for the <strong>TreeListView</strong> control<br />

this.treeListView1.SuspendUpdate();<br />

10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!