Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
535
Changing the appearance of ultragridRow on DragOver and reset on DragLeave
posted

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