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

RadTileView how to set drag cue feedback deny drop

3 Answers 62 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 15 Sep 2014, 02:37 PM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 16 Sep 2014, 11:28 AM
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.
 
0
Vincent
Top achievements
Rank 1
answered on 16 Sep 2014, 11:49 AM
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
0
Zarko
Telerik team
answered on 17 Sep 2014, 04:24 PM
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.
 
Tags
TileView
Asked by
Vincent
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Vincent
Top achievements
Rank 1
Share this question
or