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

Drag and Drop element - copy

1 Answer 58 Views
Panorama
This is a migrated thread and some comments may be shown as answers.
Marek Kruk
Top achievements
Rank 1
Marek Kruk asked on 18 Jul 2013, 10:19 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jul 2013, 09:06 PM
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 >>
Tags
Panorama
Asked by
Marek Kruk
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or