Hi,
We are having an Ultragrid which displays multiple controls in each cell.
Now the problem is that we need to get information displayed on each controls without entering into edit mode of the cell and then show it as tool tip. Entering the edit mode of a cell on hovering degrades the performance.
- Is there any way we can get current cursor position within a cell?
- We also need the control to which the cursor is pointing. so, is there any way to implement this?
A sample program is already attached.
Thanks,
mridulagarg said:- Is there any way we can get current cursor position within a cell?
void ultraGrid_MouseHover(object sender, EventArgs e){ UltraGrid grid = sender as UltraGrid; if ( grid == null ) return;
Point clientPos = grid.PointToClient(Cursor.Position); UIElement controlElement = grid.DisplayLayout.UIElement; UIElement elementAtPoint = controlElement.ElementFromPoint(clientPos);
while ( elementAtPoint != null ) { CellUIElement cellElement = elementAtPoint as CellUIElement; if ( cellElement != null ) { Rectangle rect = cellElement.RectInsideBorders; Point relativePos = new Point( clientPos.X - rect.Left, clientPos.Y - rect.Top ); }
elementAtPoint = elementAtPoint.Parent; }}
mridulagarg said:- We also need the control to which the cursor is pointing. so, is there any way to implement this?