all groups > dotnet windows forms > february 2007 >
You're in the

dotnet windows forms

group:

Get location of CurrentCell in DataGridView


Get location of CurrentCell in DataGridView Lennart Nielsen
2/7/2007 3:29:02 PM
dotnet windows forms:
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

Re: Get location of CurrentCell in DataGridView ClayB
2/7/2007 5:08:19 PM
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.
AddThis Social Bookmark Button