Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Reposition selected nodes not working
posted

 Hi,

I'm trying to repostion the selected nodes in the treeview to the top and keep the sorting on the text ascending. Im using the Infragistics2.Win.UltraWinTree.v7.1.dll version: "7.1.20071.1048", framework 2.0, VS2005. Below is my code:

      Public Sub SortBySelection()

            'Gather all  checked nodes
           
Dim node As IW.UltraWinTree.UltraTreeNode
            Dim checkedNodes As New Collections.ArrayList
            For Each node In lstItems.Nodes
                If node.CheckedState = CheckState.Checked Then
               
    checkedNodes.Add(node)
                End If
           
Next

            'Put the gathered nodes in front off the first node

            'Backwards to keep the sorting  correct

            If Not checkedNodes Is Nothing AndAlso checkedNodes.Count > 0 Then
                 
Dim i As Integer
                 
For i = (checkedNodes.Count - 1) To 0 Step -1
                     checkedNodes(i).Reposition(lstItems.Nodes(0), IW.UltraWinTree.NodePosition.Previous)
                  Next
            End If
     
End Sub

When running this code the nodes don't get repositioned. I'm I making a mistake here? I think this should work just fine and even believe that this used to work in older infragistics version, although I can't be completely sure of that.

Kind regards,

 Jos ter Doest
WiZZiX