Users sometimes need to move the content from one GDBG cell to another cell, but the application asks the user to confirm this is what he wants to do before carrying out the move. I use the drag-drop features of GDBG by handling the DragDrop event.
In the event handler I have the code ask the user if he wants to do the move. Carrying out the move (modifying the underlying data source content) works fine if he says yes. But if he says no, although the underlying data is not moved, the visible cell rendered in the grid appears to have moved.
Is there a way to cancel the drop, restoring the grid back to the original appearance before the drag-drop event? I''ve tried setting e.Effect = DragDrofEffects.None in the DragDrop event handler but this seems to have no effect. For performance reasons, I wanted to avoid refreshing the entire grid if possible.
ADAdministrator Syncfusion Team June 27, 2005 03:26 AM
I was able to do this by deriving the GridDataBoundGrid and Effect = None before calling the baseclass in OnDragDrop.
Trying to use events, you cannot control the order of the handlers. You need to set the Effect = None before any handlers get a chance to operate on the data. The only way I know to do this is to use a derived grid.