DataGridView Cell XY Location

Joined
Sep 3, 2008
Messages
19
Programming Experience
1-3
I have a datagridview on my form and I want to know the location of a cell in the datagridview. For example, I want to know the xy location of the cell in the second row of the second column. I used the following code:

dg_Schedule.Rows(6).Cells(1).ContentBounds.Y


The above code doesn't work because the Y point gives the wrong value and doesn't change when I scroll. How can I resolve this problem? I want to know the location even if there's no scrolling.

If I want to place a listview on top of a cell in the datagridview, how would I make it move along with the datagridview while the user is scrolling it?



Thanks.


:)
 
dgv.GetCellDisplayRectangle
 
Back
Top