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
1935
UltraGrid - clip mouse to row at MouseDown event
posted

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 ?