Selecting after drag/drop

2 posts, 0 answers
  1. Derek
    Derek avatar
    12 posts
    Member since:
    Mar 2008

    Posted 31 Oct 2008 Link to this post

    This is probably a dumb question but I can't seem to figure it out.  How can I select the node that just got dropped somewhere?  I know of the .selected property but I am not sure how to reference it.  Here is my drag & drop code:

    Private Shared Sub PerformDragAndDrop(ByVal dropPosition As RadTreeViewDropPosition, ByVal sourceNode As RadTreeNode, ByVal destNode As RadTreeNode) 
            If (sourceNode.Equals(destNode) OrElse sourceNode.IsAncestorOf(destNode)) Then 
                Return 
            End If 
            sourceNode.Owner.Nodes.Remove(sourceNode) 
            Select Case (dropPosition) 
                Case RadTreeViewDropPosition.Over 
                    ' child 
                    If Not sourceNode.IsAncestorOf(destNode) Then 
                        destNode.Nodes.Add(sourceNode) 
                    End If 
                Case RadTreeViewDropPosition.Above 
                    ' sibling - above                     
                    destNode.InsertBefore(sourceNode) 
                Case RadTreeViewDropPosition.Below 
                    ' sibling - below 
                    destNode.InsertAfter(sourceNode) 
            End Select 
        End Sub 

  2. Yana
    Admin
    Yana avatar
    4806 posts

    Posted 03 Nov 2008 Link to this post

    Hi Derek,

    I suggest you use the following code line right after Select Case statement:

    sourceNode.Selected = true 

    Kind regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top