Get location of CurrentCell in DataGridView

  • Thread starter Lennart Nielsen
  • 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
 
C

ClayB

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top