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. Image for the cookie policy date
close icon

Not receiving SelectionDragging or SelectionDragged events

I'm trying to tap into the drag and drop of cells within a grid control and figure that I need to capture the SelectionDragging and SelectionDragged events in order to do so. Unfortunately, the grid control does not seem to be firing these events. Are there any settings that I need to change to get these events? What I want to do is change the information that get placed on the clipboard to my own custom format for use when dragging a cell outside of the grid. Thanks, Tony

2 Replies

CB Clay Burch Syncfusion Team August 30, 2002 09:06 PM UTC

The SelectionDragging and SelectionDragged are fired when you started dragging a whole column or whole row that you have previously selected by clicking the header. These event are not part of the OLE D&D support in Essential Grid. The OLE D&D events are the standard Control events such as DragEnter, DragDrop, DragLeave, DragOver. If you want to do custom D&D support, you would probably want to override OnMoudeDown and if the click is on selected cells, then do your own call to DoDragDrop passing in your custom data object.


SH Stefan Hoenig Syncfusion Team August 31, 2002 10:47 PM UTC

Tony, I wanted to add a couple of general notes to this discussion about OLE Dnd. For determining if the cursor is over the edge of a selected range you can call HitTest and check for GridHitTestContext.SelectedRangeEdge Check out also RegisterDataObjectConsumer in the class reference. It lets you register a custom IGridDataObjectConsumer class that adds support for dropping custom data onto the grid. This solution integrates better with the grid than listening to DragEnter/DragLeave events. Right now there is no event that lets you supply custom data when the grid starts an OLE Dnd operation, but we'll take care on this so that this becomes more flexible. You need to override OnMouseDown, do a hit test and start the OLE Dnd operation. Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon