A
andrewcw
OK - neither of these two ideas work to return the cell
row/column correctly. Why ? - CurrentCell returns
different numbers for the same column when I go back and
forth bewteen columns. The HitInfo is just returning type
="Caption", not "Cell". Please provide me some working
sample code or tell me how to fix either of thsee types !
[ my x,y coordinates are always the same value too x = 24,
y = 8, no matter where I mouse down in the grid QCDG.
Thanks
private void QCDG_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
string foo = QCDG.CurrentCell.ToString();
InfoDisplay(foo);
int x;
int y;
x= QCDG.Location.X;
y=QCDG.Location.Y;
System.Drawing.Point pt = new Point(x,y);
DataGrid.HitTestInfo hti = QCDG.HitTest(pt); //hti =
QCDG.HitTest(pt);
if ( hti.Type== DataGrid.HitTestType.Cell)
{
foo= QCDG[hti.Row, hti.Column].ToString();
InfoDisplay(foo);
}
else
{ foo = hti.Type.ToString();
InfoDisplay(foo);
}
}
row/column correctly. Why ? - CurrentCell returns
different numbers for the same column when I go back and
forth bewteen columns. The HitInfo is just returning type
="Caption", not "Cell". Please provide me some working
sample code or tell me how to fix either of thsee types !
[ my x,y coordinates are always the same value too x = 24,
y = 8, no matter where I mouse down in the grid QCDG.
Thanks
private void QCDG_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
string foo = QCDG.CurrentCell.ToString();
InfoDisplay(foo);
int x;
int y;
x= QCDG.Location.X;
y=QCDG.Location.Y;
System.Drawing.Point pt = new Point(x,y);
DataGrid.HitTestInfo hti = QCDG.HitTest(pt); //hti =
QCDG.HitTest(pt);
if ( hti.Type== DataGrid.HitTestType.Cell)
{
foo= QCDG[hti.Row, hti.Column].ToString();
InfoDisplay(foo);
}
else
{ foo = hti.Type.ToString();
InfoDisplay(foo);
}
}