hi, i am trying to clip the mouse to the row at MouseDown event but i can't seem to get the dimentions correctly , it misses the row
Infragistics.Win.UIElement mouseDownUIElement; Infragistics.Win.UltraWinGrid.UltraGridCell mouseDownCell;
mouseDownUIElement = ug.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y)); mouseDownCell = null;
// retrieve the Cell from the UIElement if (mouseDownUIElement != null) { mouseDownCell = mouseDownUIElement.GetContext(typeof(UltraGridCell)) as UltraGridCell; if (mouseDownCell != null) { Rectangle mouseDownRec = ug.Rows[mouseDownCell.Row.Index].GetUIElement().Rect; mouseDownRec.Offset(1,this.Location.Y); Cursor.Clip = mouseDownRec; } }
any ideas ?
Hello sharik,
Could you please try the following line alone:
Cursor.Clip = ultraGrid1.RectangleToScreen(ultraGrid1.ActiveRow.GetUIElement().Rect);
Please feel free to let me know if I misunderstood you or if you have any other questions.
supurb, that was what i wanted, too bad i didnt think of it my self.
note that the rectangle still was just 1 pixel too heigh and i did the following and now its exact!
Rectangle r = ug.ActiveRow.GetUIElement().Rect;
r.Height = r.Height - 2;
r.Offset(0,1);
// r.Location.Y + 1
Cursor.Clip = ug.RectangleToScreen(r);
thank you again and again :)