This is a migrated thread and some comments may be shown as answers.

TreeView_DragDrop event not working.

2 Answers 184 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Raj Sharma
Top achievements
Rank 1
Raj Sharma asked on 12 Feb 2010, 09:07 PM

I have control inherited from RadTreeView.

In my constructor i have set

 

AllowDragDrop =

true;

 

void

 

TreeView_ItemDrag(object sender, RadTreeViewEventArgs e)

 

{

 

   //Does nothing

 

}

 

void

 

TreeView_DragEnter(object sender, DragEventArgs e)

 

{

e.Effect =

DragDropEffects.Move;

 

}

 

void

 

TreeView_DragDrop(object sender, DragEventArgs e)
{
  //My business logic....
}

TreeView_DragDrop even is never get executed when i drop a RadTreeNode before/after another RadTreeNode in the view.

Please help...

 

2 Answers, 1 is accepted

Sort by
0
Raj Sharma
Top achievements
Rank 1
answered on 12 Feb 2010, 09:20 PM

I also found that if i add below code then the system do execute the TreeView_DragDrop(object sender, DragEventArgs e) event

 

 

void TreeView_ItemDrag(object sender, RadTreeViewEventArgs e)

 

{

     DoDragDrop(e.Node, DragDropEffects.Move);

 

}

But this do not solve the problems as now i do not get the Line while dragging and also the RadTreeNode which I am dragging is not shown moving in RadTreeView.

Cheers,
Raj

0
Victor
Telerik team
answered on 15 Feb 2010, 09:17 AM
Hi Raj Sharma,

Thank you for writing. Please do not mix standard OLE drag & drop method calls with the automatic drag & drop that RadTreeView provides. The DoDragDrop() method is a .NET method (not provided by Telerik) and is not guaranteed to work with Telerik controls in all cases. When you call DoDragDrop(), the method installs a modal message loop which handles all WM_MOUSEMOVE events and none get to RadTreeView, this is why you have no line. 

The OLE Drag & Drop events, methods and properties, which are members of Control are:

AllowDrop,
DragEnter,
DragLeave,
DragOver,
GiveFeedBack,
QueryContinueDrag,
DoDragDrop()

RadTreeView drag & drop events and properties are:

DragEnding,
DragEnded,
DragOverNode,
DragStarted,
DragStarting,
AllowDragDrop,
AllowDragDropBetweenTreeViews

Please choose which mechanism you will use and use it consistently. Write again if you have other questions.

Best wishes,

Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Treeview
Asked by
Raj Sharma
Top achievements
Rank 1
Answers by
Raj Sharma
Top achievements
Rank 1
Victor
Telerik team
Share this question
or