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

DragVisual window

4 Answers 86 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Roar
Top achievements
Rank 1
Roar asked on 28 Jul 2015, 08:19 AM

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

Sort by
0
Accepted
Nasko
Telerik team
answered on 30 Jul 2015, 03:29 PM
Hello Roar,

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
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 Feedback Portal and vote to affect the priority of the items
0
Roar
Top achievements
Rank 1
answered on 01 Aug 2015, 01:48 PM

Hi,

Thanks, your suggestion worked just perfect :-)

Regards,

Roar

0
Raul
Top achievements
Rank 1
answered on 07 Jun 2016, 05:52 PM

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

0
Nasko
Telerik team
answered on 09 Jun 2016, 08:20 AM
Hi 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
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
DragAndDrop
Asked by
Roar
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Roar
Top achievements
Rank 1
Raul
Top achievements
Rank 1
Share this question
or