RadTileView how to set drag cue feedback deny drop

4 posts, 1 answers
  1. Vincent
    Vincent avatar
    8 posts
    Member since:
    Mar 2012

    Posted 15 Sep 2014 Link to this post

    Hello,

    we are using the DragDropManager to manage the drag/drop of items between a RadTileView from/to other type of controls. This works fine.
    I have a question after reading this article: http://www.telerik.com/help/wpf/radtreeview-how-to-set-drag-cue-feedback-deny-drop.html
    is it possible to accomplish the mentioned functionality (set drag cue feedback deny drop) with a RadTileView control instead of a RadTreeView?

    thanks in advance,
    Vincent
  2. Answer
    Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 16 Sep 2014 Link to this post

    Hello Vincent,
    In order to change the DragVisual runtime you'll have to use a ContentControl and change its Content/ContentTemplate instead:
    private ContentControl dragCue = new ContentControl();
     
    private void OnDragInitialized(object sender, DragInitializeEventArgs args)
    {
        ...
            this.dragCue.Content = draggingImage;
            args.DragVisual = this.dragCue;
        ...
    }
     
    private void OnDragOverDontDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
    {
        this.dragCue.ContentTemplate = this.Resources["customTemplate"] as DataTemplate;
    }
    This way the DragVisual will be the same object but you'll be able to change its appearance.
    I've attached a sample project demonstrating this so could you please examine it and if you have more questions feel free to ask.

    Regards,
    Zarko
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Vincent
    Vincent avatar
    8 posts
    Member since:
    Mar 2012

    Posted 16 Sep 2014 in reply to Zarko Link to this post

    Hello Zarko,

    thank you for your anwer. I had found a similar answer here that worked for me:
    http://www.telerik.com/forums/changing-the-payload-on-ondragover
    The trick is to have a global reference to the DragVisual and completely replace it's content when the drag goes over the forbidden area. Your solution probably has the same effect, but with the ContentTemplate instead. By the way, if I run your project i don't see any items show up in the TileView control. So I can't check if the solution is truly working but the problem is solved for me anyway. Thanks.

    Vincent
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 17 Sep 2014 Link to this post

    Hi Vincent,
    This is very strange - could you please check what dlls are you using ? If you're using our xaml dlls everything should be working fine but if you're using our NoXaml dlls you'll have to include the styles in your app.xaml:
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
    I hope I was able to help you and if you still have problems running my sample application please contact us again.

    Regards,
    Zarko
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top