Drag and Drop element - copy

2 posts, 1 answers
  1. Marek Kruk
    Marek Kruk avatar
    16 posts
    Member since:
    Mar 2009

    Posted 18 Jul 2013 Link to this post

    Hi,
    I need to make a copy when you drag an item instead of moving.
    How to do it in the easiest way?

    Thanks,
    Marek
  2. Answer
    Dess
    Admin
    Dess avatar
    1601 posts

    Posted 19 Jul 2013 Link to this post

    Hello Marek,

    Thank you for contacting Telerik Support.

    In order to make a copy of the dragging RadTileElement you should use the following code snippet:
    public Form1()
            {
                InitializeComponent();
     
                this.radPanorama1.PanoramaElement.DragDropService.PreviewDragDrop += DragDropService_PreviewDragDrop;
            }
            private void DragDropService_PreviewDragDrop(object sender, Telerik.WinControls.RadDropEventArgs e)
            {
                RadTileElement dragTileElement = e.DragInstance as RadTileElement;
                RadTileElement copyTileElement = new RadTileElement();
                copyTileElement.Text = dragTileElement.Text;
                copyTileElement.Image = dragTileElement.Image;
                copyTileElement.ImageLayout = dragTileElement.ImageLayout;
                 
                TileGroupElement dragTileGroup = dragTileElement.Parent.Parent as TileGroupElement;
                dragTileGroup.Items.Add(copyTileElement);
     
                copyTileElement.Row = dragTileElement.Row;
                copyTileElement.RowSpan = dragTileElement.RowSpan;
                copyTileElement.Column = dragTileElement.Column;
                copyTileElement.ColSpan = dragTileElement.ColSpan;
            }

    I hope this helps.  Please let me know if I can assist you any further with this service request.  

    Regards,

    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top