DatagridviewCell PointToScreen

Hello.

I want to display a window form underneath a datagridview cell as a pop up box. I need to find out the location in screen cordinates where the datagridviewcell is so I can display the winform there. However, my datagridview has a scrollbar, so I cant just simply take the datagridview point to screen and adjust width and height according to row position (I would need to know the scroll position num to offset row position). Is there an easy way to do what I want to do?

[493 byte] By [Blast] at [2007-12-25]
# 1

In VB 2005 I did:

Dim _pointCell As Point = Me.OrderDetailDataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, True).Location

Dim _pointGrid As Point = OrderDetailDataGridView.Location

Dim _pointLocation As Point

_pointLocation.X = _pointGrid.X + _pointCell.X

_pointLocation.Y = _pointGrid.Y + _pointCell.Y

Me.ComboBox1.Location = _pointLocation

This will move the ComboBox to be directly over the cell selected.

DRuth at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...