Hello,
I upgraded from version 2012.3.1129.40 to 2013.3.1204.40.
In our application, we can drag a node from a treeview and drop it in a WinForms control.
With the old version of Telerik, we were able to change the TreeViewDragCue object from the WinForm control, like this:
Now with the new version, I'm using the recommended DragDropManager and DragDropPayloadManager objects, I tried this:
Unfortunately, the options object is always null.
Is there a way to change the TreeViewDragVisual object to give a feedback ?
Best regards,
I upgraded from version 2012.3.1129.40 to 2013.3.1204.40.
In our application, we can drag a node from a treeview and drop it in a WinForms control.
With the old version of Telerik, we were able to change the TreeViewDragCue object from the WinForm control, like this:
RadDragAndDropManager.Options.Effects = ConvertToWpfEffects(effects);
var l_cue = RadDragAndDropManager.Options.DragCue
as
Telerik.Windows.Controls.TreeView.TreeViewDragCue;
if
(l_cue !=
null
)
{
switch
(effects)
{
case
DragAndDropEffects.Copy:
l_cue.DragActionContent =
"Copy To"
;
l_cue.IsDropPossible =
true
;
break
;
case
DragAndDropEffects.Move:
l_cue.DragActionContent =
"Link With"
;
l_cue.IsDropPossible =
true
;
break
;
default
:
l_cue.IsDropPossible =
false
;
break
;
}
}
Now with the new version, I'm using the recommended DragDropManager and DragDropPayloadManager objects, I tried this:
private
void
OnDragOver(
object
sender, System.Windows.Forms.DragEventArgs e)
{
var options = DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key)
as
TreeViewDragDropOptions;
if
(options !=
null
)
{
var l_dragVisual = options.DragVisual
as
TreeViewDragVisual;
switch
(effects)
{
case
DragAndDropEffects.None:
options.DropAction = DropAction.None;
if
(l_dragVisual !=
null
)
{
l_dragVisual.IsDropPossible =
false
;
options.UpdateDragVisual();
}
break
;
case
DragAndDropEffects.Copy:
options.DropAction = DropAction.Delete;
if
(l_dragVisual !=
null
)
{
l_dragVisual.IsDropPossible =
true
;
options.UpdateDragVisual();
l_dragVisual.DropActionText =
"Copy To"
;
}
break
;
case
DragAndDropEffects.Move:
options.DropAction = DropAction.Delete;
if
(l_dragVisual !=
null
)
{
l_dragVisual.IsDropPossible =
true
;
options.UpdateDragVisual();
l_dragVisual.DropActionText =
"Link With"
;
}
break
;
}
}
}
Unfortunately, the options object is always null.
Is there a way to change the TreeViewDragVisual object to give a feedback ?
Best regards,