We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to improve WinForms TreeViewAdv's performance when selecting more than a thousand nodes?

Platform: WinForms |
Control: TreeViewAdv

Performance of TreeViewAdv

The performance of TreeViewAdv when selecting more than thousand nodes can be improved by handling the following TreeViewAdv events:

1. MouseUp event

2. KeyUp event

3. KeyDown event


void treeViewAdv1_MouseUp(object sender, MouseEventArgs e)
    if(Control.ModifierKeys == Keys.Shift)
       TreeNodeAdv node = this.treeViewAdv1.PointToNode(e.Location);
       int index = this.treeViewAdv1.NodeToRowIndex(node);
       int endindex = this.treeViewAdv1.NodeToRowIndex(this.treeViewAdv1.SelectedNode);
       int incre=index>endindex?-1:1;                
       for (int i = index; ; i += incre)
           if(endindex == i)


Private Sub treeViewAdv1_MouseUp(sender As Object, e As MouseEventArgs)
   If Control.ModifierKeys = Keys.Shift Then
      Dim node As TreeNodeAdv = Me.treeViewAdv1.PointToNode(e.Location)
      Dim index As Integer = Me.treeViewAdv1.NodeToRowIndex(node)
      Dim endindex As Integer = Me.treeViewAdv1.NodeToRowIndex(Me.treeViewAdv1.SelectedNode)
      Dim incre As Integer = If(index > endindex, -1, 1)
      Dim i As Integer = index
      While True
           If endindex = i Then
              Exit While
           End If
           i += incre
      End While
   End If
End Sub

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/TreeViewAdvSample946095543.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile