You can grab the mouse positon (Control.MouseP osition) in the MouseHover
event handler, translate the coordinates into something appropriate to the
DataGrid (dataGrid1.Poin tToClient()), determine the portion of the DataGrid
over which the mouse is hovering (dataGrid1.HitT est()), and then examine the
HitTestInfo that is returned to determine if the mouse is over a cell and,
if so, which cell.
private void dataGrid1_Mouse Hover(object sender, System.EventArg s e)
{
DataGrid grid = (DataGrid)sende r;
Point clientPos = grid.PointToCli ent(Control.Mou sePosition);
DataGrid.HitTes tInfo hitInfo = grid.HitTest(cl ientPos);
if (hitInfo.Type == DataGrid.HitTes tType.Cell)
{
// this.dataGrid1[hitInfo.Row, hitInfo.Column]
}
}
--
Tim Wilson
..NET Compact Framework MVP
"melanieab" <me*******@disc ussions.microso ft.com> wrote in message
news:FF******** *************** ***********@mic rosoft.com...
Hi,
How can you determine which cell the mouse is positioned over during the
mousehover event?
Thanks so much!
Mel