DragVisual window

5 posts, 1 answers
  1. Roar
    Roar avatar
    9 posts
    Member since:
    Jul 2012

    Posted 28 Jul 2015 Link to this post

    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

  2. Answer
    Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 30 Jul 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Roar
    Roar avatar
    9 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2015 in reply to Nasko Link to this post

    Hi,

    Thanks, your suggestion worked just perfect :-)

    Regards,

    Roar

  5. Raul
    Raul avatar
    20 posts
    Member since:
    Apr 2014

    Posted 07 Jun in reply to Nasko Link to this post

    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

  6. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 09 Jun Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready