I am trying to drop an object onto a Grid Control. I set up the drag/drop operation in Form1 of an MDI app like this:
private void songListView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
Form2 includes the following:
gridControl1.AllowDrop = true;
gridControl1.Model.Options.DragDropDropTargetFlags = GridDragDropFlags.Text;
private void gridControl1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
e.Effect = DragDropEffects.Copy;
e.Effect = DragDropEffects.None;
I verified that the DragEnter handler IS being called correctly. However, my mouse cursor never changes to the "Allow Drop" mode anf gridControl1_DragDrop() does not get called when I drop.
ADAdministrator Syncfusion Team August 4, 2003 03:30 PM
Try this. It creates a DataObject and sets the DataFormats.Text datatype so it could be tested in the grid. It also specifies DragDropEffects.All so you do not have to press the shift to do the drop. Since the source is responsible for deleting the moved object, it will not do any harm to accept all actions in the grid.
private void Form1_MouseDown(object sender, MouseEventArgs e)
String s = "Testing...";
DataObject data = new DataObject(DataFormats.Text, s);