$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
TreeView WinForms Control
Build complex navigation systems and display complex hierarchical structures
Home > WinForms UI Controls > User Manual > Drag and Drop TreeView in C#

KetticTreeView Drag and Drop Support in C#.NET

KetticTreeView control support drag and drop functionality, so that it expands the Windows Forms application capabilities. For example, developers can easily drag and drop nodes within the TreeView control or among a few TreeView controls, locate the node place, drag and drop nodes in other elements, scroll up and down a dragging node automatically, expand a dragging node automatically, and fine-tune specific nodes when dragging and dropping.

Events for Building Drag and Drop of KetticTreeView

KetticTreeView control for Windows Forms contains two properties, EnableDragDrop and Enable Drop, for the TreeView UI designers to apply the drag and drop feature to their Windows applications.
  • EnableDragDrop, when we set this property to be true, the developers can apply both the drag and drop feature to the KetticTreeView control. Furthermore, this functionality is capable of reordering nodes of KetticTreeView
  • EnableDrop, when assigning this event to be true, it is able to accept data that is dragged onto it and is capable of interacting with drag and drop for standard Windows controls.

Enable Drag and Drop for KetticTreeView Control

To enable the drag and drop functionality for KetticTreeView, we can simply change the value of the EnableDragDrop property to be true. This functionality also supports drag and drop both the parent node and child node that are selected to the desired position.

Enable the Drop functionality to Make KetticTreeView Accept Data

To enable the drop functionality, we can set the EnableDrop event to be true. This event is able to make the KetticTreeView accept data that are dropped on it and allows the developers to interact with the standard WinForms controls. The following example demonstrates how to implement the drop functionality.
  • Change the EnableDrop to be true for KetticTreeView control and the KetticTextBox in Windows Forms application.
  • Call the DoDragDrop() method of the KetticTextBox HostedControl via the MouseDown event handler
  • Modify the arguments Effects property via the KetticTreeView DragEnter event handler
  • React the drop operation via the KetticTreeView DragDrop event handler
  • Copy and paste the C# code below to retrieve the dropped node for the PointToClient() and GetNodeAt() methods of KetticTreeView component
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls