Get location of CurrentCell in DataGridView

  • Thread starter Thread starter Lennart Nielsen
  • Start date Start date
L

Lennart Nielsen

I have not been able to find a way to get the actual Location coordinates
(Left and Top), only the X and Y index.
The only thing I've found so far is to use the paint event to map the values
to variables, but I always seem to be one click behind.

Any suggestions?

Lennart
 
Maybe this code will give you what you want.

DataGridViewCell cc = this.dataGridView1.CurrentCell;
Rectangle rect =
this.dataGridView1.GetCellDisplayRectangle(cc.ColumnIndex,
cc.RowIndex, true);

==============
Clay Burch
Syncfusion, Inc.
 
Back
Top