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

Drag from RadGallery

2 Answers 83 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
deepak
Top achievements
Rank 1
deepak asked on 03 Aug 2011, 03:27 PM
Hi all
I am unable to drag an item from RadGallery. I am attaching the sample code. It works fine with image. but not within RadGak

<Window x:Class="RadControlsWpfApp1.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525" telerik:RadDragAndDropManager.DragQuery="Window_DragQuery">
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
            <telerik:RadGallery>
            <telerik:RadGalleryItem telerik:RadDragAndDropManager.AllowDrag="True" Image="/RadControlsWpfApp1;component/PDF-04.png"></telerik:RadGalleryItem>
        </telerik:RadGallery>
        <Image Source="/RadControlsWpfApp1;component/PDF-04.png" Grid.Row="1" telerik:RadDragAndDropManager.AllowDrag="True"/>
    </Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
 
namespace RadControlsWpfApp1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void Window_DragQuery(object sender, Telerik.Windows.Controls.DragDrop.DragDropQueryEventArgs e)
        {
            MessageBox.Show("draged");
        }
    }
}

Thanks
Deepak

2 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 04 Aug 2011, 08:40 AM
Hello Deepak,

I assume you are using version 2011.2 712. If this is the case  I can recommend one of the following solutions:

 - set RadDragAndDropManager.ExecutionMode = DragExecutionMode.Legacy (set in the app constructor)
 - set DragDropManager.AllowCapturedDrag="true" (available in our latest internal build) in addition to telerik:RadDragAndDropManager.AllowDrag="True"

Let us know if you have any further issues.

Kind regards,
Tsvyatko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
deepak
Top achievements
Rank 1
answered on 04 Aug 2011, 02:48 PM
Hi
I got the following error.
{"The specified Visual and this Visual do not share a common ancestor, so there is no valid transformation between the two Visuals."}
Thanks
Deepak
Tags
DragAndDrop
Asked by
deepak
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
deepak
Top achievements
Rank 1
Share this question
or