[Extracted from the How to change XtraTreeList drag-and-drop icons ticket ]
This event only fires when a Node is about to be dragged. I would like to be able to change the icons based on the Drag Node AND the Drop Node in the DragOver event. Is this possible?
Hello,
I have tested this approach and on my side this event fires on each mouse move. Please check the attached project and video, and modify the project to illustrate your scenario. I am looking forward to your response.
Sorry for my incorrect statement. Yes the CalcNodeDragImageIndex fires everytime, but if I was able to change the Image via the DragOver event I have access to both the Drag Node and the Target Node. I believe the CalcNodeDragImageIndex only provides access to the DragNode?
What I am building is functionality to enable a Grid Layout to be built using a TreeList view of the Grid… ie nodes representing Bands and Columns from the Grid. Obviously there are rules as to where a Grid Column can exist… for example it cannot exist under a Band which has child bands… so I am testing for this in the Drag Over event and setting the e.Effect to None or Move and want to be able to set the DragNodeImageIndex at the same time.
So I am not saying there is a bug or issue, just that I would like to be able the set the DragImageIndex during the DragOver event where I am testing the dragdrop conditions…
I have provided a screen snapshot of my function currently working (except for node images…)
Cheers
Jeff
Hello,
It is possible to obtain both the target and drag nodes. You can obtain the target node from the e.Node property and drag the node from e.DragArgs as follows:
Dim node As TreeListNode = CType(e.DragArgs.Data.GetData(GetType(TreeListNode)), TreeListNode)
So, you can change a drag image in this event handler based on your own logic.
I hope this helps. Should you have any further questions, feel free to contact me at any time.