I have modified the tests to be compatable with MOSS webpart. Specifically, I test UniqueID instead of value (which was not returning anything).
Case "move up"
ls_MsgTxt =
"Move Up Start" '& e.Node.UniqueID.ToString & "' / '" & e.Node.ParentNode.Nodes(0).UniqueID.ToString & "'"
'statusLabel.Text = ls_MsgTxt
'move the selected node one place up
'here's what we're gonna do:
'Check if this node is already at the top
'If not, switch it with the node directly above him, same goes for moving the node down...
If Not e.Node.UniqueID = e.Node.ParentNode.Nodes(0).UniqueID Then
ls_MsgTxt =
"Move Up . " ' & e.Node.ParentNode.Nodes.Count.ToString
'statusLabel.Text = ls_MsgTxt
Dim i As Integer = 0
While i < e.Node.ParentNode.Nodes.Count
ls_MsgTxt =
"Move Up .. " '& i.ToString & " / " & e.Node.ParentNode.Nodes.Count.ToString
If e.Node.UniqueID = e.Node.ParentNode.Nodes(i).UniqueID Then
ls_MsgTxt =
"Moved Up" '& e.Node.UniqueID.ToString & " / " & e.Node.ParentNode.Nodes(i).UniqueID.ToString
'Because of the i-value, we are going to 'walk' through the
'second layer of the tree (radtreeview1.nodes(0).nodes)
'This part is a bit nasty programming, first we remove the node before the node we want to move
'our nodeclicked is now automatically moving one place up,
'than we insert the removed node one place under the moved node
'et voila
Dim tempNode As New Telerik.Web.UI.RadTreeNode
tempNode = e.Node.ParentNode.Nodes(i - 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.RemoveAt(i - 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.Insert(i, tempNode)
End If
i += 1
End While
End If
Case "move down"
'move the selected node one place down
If Not e.Node.UniqueID = e.Node.ParentNode.Nodes(e.Node.ParentNode.Nodes.Count - 1).UniqueID Then
Dim i As Integer = 0
While i < e.Node.ParentNode.Nodes.Count
If e.Node.UniqueID = e.Node.ParentNode.Nodes(i).UniqueID Then
'Because of the i-value, we are going to 'walk' through the
'second layer of the tree (radtreeview1.nodes(0).nodes)
'This part is a bit nasty programming, first we remove the node AFTER the node we want to move
'our nodeclicked is now automatically moving one place down,
'than we insert the removed node one place ABOVE the moved node
'et voila
Dim tempNode As New Telerik.Web.UI.RadTreeNode
tempNode = e.Node.ParentNode.Nodes(i + 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.RemoveAt(i + 1)
m_RadTreeFolderHierarchy.Nodes(0).Nodes.Insert(i, tempNode)
Exit While
End If
i += 1
End While
End If