Hello, I am trying to prepare an easy setup to activate drag and drop between two grids.
Edit: now I discovered that BehaviorManager must be placed onto the grid to make the Drag And Drop Behavior option display in Run Designer window.
How can I use BehaviorManager to set up drag and drop between two grids when each grid is contained in a UserControl (both UC of same type) because there is an additional buttons bar etc?
What I want to achieve in total:
I have been trying to generalize the drag and drop setup from this ticket
https://supportcenter.devexpress.com/ticket/details/e694 into a method which could be put into a Utilities class. Then in my project, I would simply call this method and drag and drop would work between two grids.
Also, DragAndDropCursors class which should be an enum of cursors to be used to set e.Cursor in drag and drop handling doesn't work for me as it is not an enum but in the examples, it is. See this ticket for example: https://supportcenter.devexpress.com/ticket/details/t638165, it uses DragAndDropCursors as if it were an enum.
Could you please help me find out why my code doesn't work and maybe simplify my "utility" method but also keep the option to transform the data between two grids if the data source was not the same? I would like to have "mouse cursor with rectangle sign" cursor for the drag and drop which signifies "moving" But I cannot choose this cursor from the default system Cursors enum/collection as far as I know.
Note: The ticket E694 isn't exactly where I started from with my example code because I started from an early version of the E694 example which was posted in a support ticket which I lost URL to.
In the early version of E694, some drag and drop setup had to be done also in code in addition to the behaviorManager1 present.
In the latest version of the E694 example (https://supportcenter.devexpress.com/ticket/details/e694, there is no additional setup in code of Form1.cs and there are even no events assigned to the behaviors.
I think that everything what was done was to create a behaviorManager and assign two grids to it which seems very clean and easy.
In this latest version of the E694 example, the whole target gridcontrol is glowing in blue when the items are dragged over it. I cannot see anything like that in my example. How is it achieved?
I am adding the code of my attempt in a .zip archive. It is not ideal because I have been struggling with the drag and drop setup for multiple hours today so I am maybe not paying attention to all details.
My final requirement for the utility function to enable drag and drop between two grids would be:
- the types of data source can differ, I need to provide a transformation function between type 1 and type 2 and vice versa (but default type 1 = type 2 and no transformation function)
- choose cursor
Thank you,
Jiri