I have been researching on how to drag one cell from one grid to another cell on another grid unsuccesfully. Both cells same data type.
I have found article Q181962 referring to dragging cells on the same grid and many others on how to move whole rows from one grid to another.
I am attaching a project where I present two grids and I want to move the DateTime cell from the left grid to the Start (or End) cell on the right grid.
I would appreciate some sample code as I have tried mouse down, mouse up, drag enter, drag over, drag drop, etc. and cannot get it to work.
Thank you very much.
Thank you for the question. A similar task has already been discussed in the Drag-and-drop data rows from one grid to another knowledge base article. I have also updated your sample based on this article. Please review it and inform me whether it meets your requirements.
The sample is excellent and works as expected.
I have one more favor to ask:
Is it possible to differentiate moves between grid 1 (on left) and grid 2 (on right) as opposed to moves between cells within the same grid?
Here is why, If I drag a cell from grid 1, I want to copy it to grid 2, but if I drag a cell from grid1 > Start to grid1 > End (or viceversa) then I want to move it.
Thank you very much for your prompt and accurate assistance.
I'm glad to hear that my assistance was helpful to you:)
Concerning your question: I can suggest the following approach:
1. Save a source View and cell within the MouseDown event handler.
2. Within the DragDrop event handler, check if the source View is not equal to a target View, and if so, clear the content of the source cell.
Attached is an updated sample illustrating how this can be implemented.