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

Drag Drop Column to other Control

1 Answer 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sven Jesper
Top achievements
Rank 1
Sven Jesper asked on 13 Mar 2012, 10:42 AM
Hi

I need to "drag and drop" columns from a gridview to another control; for example a simple text box that just prints the header name when the column is droped on to it. 

I have mined the posts here and the WinFroms demo, all implementing on the drag and drop service:
  RadDragDropService dragDropService = this.radGridView1.GridViewElement.GetService<RadDragDropService>();
            dragDropService.PreviewDragOver += new System.EventHandler<RadDragOverEventArgs>(dragDropService_PreviewDragOver);
            dragDropService.PreviewDragDrop += new System.EventHandler<RadDropEventArgs>(dragDropService_PreviewDragDrop);

 However, it seems that PreviewDragOver  and PreviewDragDrop  events are fired only when hitting on the listed members here:
http://www.telerik.com/help/winforms/t_telerik_wincontrols_ui_listcontroldragdropservice.html 

and not a textbox or other generic container.

My question is: is there anyway i can allow and detect a column drop using some other code OR implement a new control that will implement the radservice

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 16 Mar 2012, 09:31 AM
Hello Sven,

Yes, your assumption is correct. Only controls which implement the described interface can benefit from the built-in drag & drop mechanism. In your scenario the best option is to implement OLE drag & drop. You can read more about that in this MSDN article.

If you have further questions, do not hesitate to ask.
 
Kind regards,
Jack
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Sven Jesper
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or