I’m using the treeview to visualize a filesystem based on a directory list. This list came from a hardrive.
I feed this list of strings to the function shown below.
It is the same function from the desktop app.
The desktop app can populate the winforms treeview with 500,000 items and display them without any lag.
The Wisej Treview cant even display 5,000 items without choking.
How can I get better performance?
Snippet
TreeView1.Nodes.Clear() TreeView1.Nodes.Add(PopulateTreeNode2(paths, "\"c))
Snippet
Public Function PopulateTreeNode(paths As String(), pathSeparator As String) As TreeNode
Dim thisnode As New TreeNode()
If paths Is Nothing Then
Return Nothing
Else
Application.StartTask(Sub()
thisnode.Text = My.Settings.JobName
Dim currentnode As TreeNode
Dim cachedpathseparator As Char() = pathSeparator.ToCharArray()
For Each path As String In paths
currentnode = thisnode
For Each subPath As String In path.Split(cachedpathseparator)
If currentnode.Nodes(subPath) Is Nothing Then
currentnode = currentnode.Nodes.Add(subPath, subPath)
Else
' currentnode = currentnode.Nodes(subPath)
End If
Application.Update(TreeView1)
Next
Application.Update(Me)
Next
End Sub)
End If
MsgBox("OK")
Return thisnode
End Function
Hi,
What about using the DataGridView control with VirtualMode? You can also build up a tree structure with this control and have the power to only show the visible nodes on client.
Jens
Load only 1 level, set the node to ShowLoader true and IsParent true and load the child nodes only on demand when the node is expanded. Try the Wisej.Web.FileOpenDialog component. You can also set VirtualScroll to true on the TreeView (which is experimental and has some issues). In general 5000 nodes result in 50,000 elements in the browser.
Please login first to submit.
