Hi,
Is there any way of closing the DragVisual window in the OnDrop Event Handler. The reason I ask is that I want to open a modal dialog when an item is dropped into a treeview. I am able to open the dialog as I want, but the DragVisual window will stay on top of the dialog. So in the OnDrop Event I want to close the DragVisual and then open the dialog window. Is this possible?
Regards,
Roar
4 Answers, 1 is accepted
What we could suggest you in order to achieve the desired is to create an additional field and inside the OnDragInitialize to set it with the DragVisual. So, when the OnDrop method gets called you could set the Visibility property of the preserved DragVisual to Collapsed and thus it will be hide before the modal window gets visualized.
Please, check the attached sample project that demonstrates that.
Hopes this helps.
Regards,
Nasko
Telerik
Hi,
Thanks, your suggestion worked just perfect :-)
Regards,
Roar
Hello,
I'm having the same problem, but I'm using two completly separated user controls and MVVM. I can't see how to get it working with a local variable in one of the controls (for the visibility) when I need to access it in both controls.
Both controls are put together in a third control:
<StackPanel>
<bp:CtlSourceView DataContext="{Binding SourceVM}"/>
<bp:CtlDestinationView DataContext="{Binding DestinationVM}"/>
</StackPanel>
Any idea?
Best Regards,
Raul
We will need some additional information about your scenario in order to provide you with a prompt solution. Between which controls drag and drop is performed? How exactly the drag and drop is implemented - some of out controls like RadListBox have built-in drag and drop functionality?
A sample project that reproduces your exact scenario will be of great help for us in order to understand your scenario and approach.
We are looking forward to hearing from you.
Regards,
Nasko
Telerik