M
MDB
Hello All, I use the below code to get the cell a user clicked in order for
the context menu to pop up and for some reason, I can click on or around the
exact same area and always get different results. Is there something that I
am missing or something I am doing wrong to get the correct cell
(row,column)? One thing I have noticed is that the first time the
contextmenu is displayed that point is always -8,-58 no mater where I click.
private void contextMenu1_Popup(object sender, EventArgs e)
{
Point pt = dgStdAreas.PointToClient( Control.MousePosition );
int x = pt.X;
int y = pt.Y;
DataGrid.HitTestInfo hti = dgStdAreas.HitTest(pt.X,pt.Y);
}
the context menu to pop up and for some reason, I can click on or around the
exact same area and always get different results. Is there something that I
am missing or something I am doing wrong to get the correct cell
(row,column)? One thing I have noticed is that the first time the
contextmenu is displayed that point is always -8,-58 no mater where I click.
private void contextMenu1_Popup(object sender, EventArgs e)
{
Point pt = dgStdAreas.PointToClient( Control.MousePosition );
int x = pt.X;
int y = pt.Y;
DataGrid.HitTestInfo hti = dgStdAreas.HitTest(pt.X,pt.Y);
}