Hi,
I am attempting to write code where the user can select/drag some rows and drop it to another area in the same grid. What I would like to happen is to highlight somehow the destination row (preferably by change the border) so that the user can visually see where they are dropping the data. So as the selection is dragged over a number rows then each row is highlighted on enter and returns back to it normal state on leave.
How would I achieve this? Anybody have any examples?
Thanks in advance.
Nish
Hi Nish,
Changing the border color of a row is not an easy thing to do, because a row does not draw all 4 of it's own borders. You can use the row.Appearance.BorderColor, but this will probably only change the color of 1 or 2 sides, so it probably won't work well.
If you want to use the BackColor of the row, then it would be a lot easier. You just have to use the DragOver event and determine what row the mouse is over and apply an appearance to that row. The only part of this that is at all tricky is determining what row the mouse is over.
Here's a KB article that will explain how you do it:
HOWTO:UltraWinGrid Mouse Position and Row Identification
Note, however, that the article uses the MouseMove event which gives you the X and Y position of the mouse in control coords. The drag events will give you the X and Y in screen coords. So you will need to use grid.PointToClient to convert the X and Y values into grid coords.
Hi Mike,
I am using Infragistics version 13.1. I created a very simple form that lets users to move rows in UltraGrid around by dragging and dropping them.
The problem is - as the user above has mentioned - that it is hard to figure out where the record that is being dragged will be dropped.
Is there a built in capability for this now (it has been over 5 years since the original post, and things may have changed), or may be you can point me to a sample code that implements it.
Thank you in advance for your help.
Helen.