RadTreeview dragdrop event not get triggered

1 Answer 105 Views
Treeview
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Aravind asked on 23 May 2023, 05:26 AM
Hi,
   I try to get even for dragdrop once node move to another location, i used following code to get event, but not success, here i attach code. i make true for   RadTreeView1.AllowDragDrop = True and  RadTreeView1.AllowDrop = True


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
   RadTreeView1.AllowDragDrop = True      
   RadTreeView1.AllowDrop = True
 ' Add event handlers for drag and drop events
   AddHandler RadTreeView1.DragEnter, AddressOf RadTreeView1_DragEnter
   AddHandler RadTreeView1.DragDrop, AddressOf RadTreeView1_DragDrop
End Sub

Private Sub RadTreeView1_DragEnter(sender As Object, e As DragEventArgs) Handles RadTreeView1.DragEnter
    ' Check if the data being dragged is a RadTreeNode
    If e.Data.GetDataPresent(GetType(RadTreeNode)) Then
        e.Effect = DragDropEffects.Move
    Else
        e.Effect = DragDropEffects.None
    End If
End Sub

Private Sub RadTreeView1_DragDrop(sender As Object, e As DragEventArgs) Handles RadTreeView1.DragDrop
    ' Check if the data being dragged is a RadTreeNode
    If e.Data.GetDataPresent(GetType(RadTreeNode)) Then
        ' Get the dragged node
        Dim draggedNode As RadTreeNode = CType(e.Data.GetData(GetType(RadTreeNode)), RadTreeNode)

        ' Get the target node
        Dim targetNode As RadTreeNode = RadTreeView1.GetNodeAt(RadTreeView1.PointToClient(New Point(e.X, e.Y)))

        ' Get the full path of the dragged node
        Dim draggedNodePath As String = draggedNode.FullPath

        ' Get the full path of the target node
        Dim targetNodePath As String = targetNode.FullPath

        ' Do something with the full paths
        MessageBox.Show("Dragged Node Path: " & draggedNodePath & vbCrLf & "Target Node Path: " & targetNodePath)
    End If
End Sub

 

Please advice me what i make mistake ? i try to get source and destination node after drag and drop nodes

Please asap.

Regards
Aravind

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 May 2023, 12:35 PM

Hi, Aravind,

Your question has already been answered in the other thread you have opened on the same topic. Please, see our answer there for more information.
We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Treeview
Asked by
Aravind
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or