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 ?

Parents
No Data
Reply
  • 71886
    Verified Answer
    Offline posted

    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.

Children