We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WinForms
Category : Datagrid

How can I implement OLE Drag & Drop between a DataGrid and another OLE DnD object that supports the Text format

The attached samples (C#, VB) have a derived datagrid that supports OLE D&D with any OLE D&D provider that handles a Text formatted data object. The derived grid handles six events to allow it to be both a drop source and a drop target. The sample project has two datagrids where you can drag cell text back and forth. You can also open Excel, and drag text between Excel and either datagrid.

Here are the events that are handled in this sample.
  • MouseDown - Used to save the row and column of a mousedown, ’mousedowncell’.
  • MouseMove - Checks to see if you drag off the mousedowncell, and if so, starts a the DoDragDrop.
  • MouseUp - Used to reset the mousedowncell.
  • DragEnter - Checks to see if the data object has text, and if so, allows a Copy operation. (This could be changed to support Move/Copy.)
  • DragOver - Used to set a NoDrop cursor if you move over the mousedowncell (if mousedowncell has been set).
  • DragDrop - Used to drop the text into the datagrid.
  • Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon