Drag from RadGallery

3 posts, 0 answers
  1. deepak
    deepak avatar
    25 posts
    Member since:
    Jan 2011

    Posted 03 Aug 2011 Link to this post

    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. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 04 Aug 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. deepak
    deepak avatar
    25 posts
    Member since:
    Jan 2011

    Posted 04 Aug 2011 Link to this post

    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
Back to Top