Hi,
I have Two UltraGrids . I'm doing a DragAndDrop of rows from the first to the second Grid..
The Drag operation start from the Grid1 to the Grid2
I want to change the Appearance of the Row when the mouse cursor on it and changed back whent leave.
I'm using the DragOver event to changed like this ::
ultraGrid2.DragOver += (s, e) => {
Point point = ultraGrid2.PointToClient(new Point(e.X, e.Y)); UIElement element = ultraGrid2.DisplayLayout.UIElement.ElementFromPoint(point); if (element != null) { UltraGridRow row = element.GetContext(typeof(UltraGridRow)) as UltraGridRow; if (row != null) { row.Appearance.BackColor = Color.Goldenrod; lastPoint = point; } } };
and the DragLeave to changed back to Original Appearance
ultraGrid2.DragLeave += (s, e) => {Point point = ultraGrid2.PointToClient(new Point(e.X, e.Y)); UIElement element = ultraGrid2.DisplayLayout.UIElement.ElementFromPoint(point ); if (element != null) { UltraGridRow row = element.GetContext(typeof(UltraGridRow)) as UltraGridRow; if (row != null) { row.Appearance.ResetBackColor(); } } } Console.WriteLine("Drag LEAVE"); };
Can you tell me the right way to get this working ..
thx
Hello Michel,
Thank you for contacting Infragistics!
In your drag leave even you are using the getting the point the mouse is at, however since this is the leave event this will no longer be the row you were hovering over. If you want to revert the style you will have to store the row/rows you have in the drag over events to be used later in the drag leave.
Thank you.
Can you post an example?
I can't make it working.
Thx