How to Get Screen Point in Windows Forms Grid Control

18 Nov 20181 minute to read

You can get the cell’s rectangle in grid coordinates from RangeInfoToRectangle method. Then with the rectangle’s coordinates, you can get the screen point using PointToScreen method.

//For a given row and col.
Rectangle rect = this.grid.RangeInfoToRectangle(GridRangeInfo.Cell(row, col));
Point screenPoint = this.grid.PointToScreen(new Point(rect.Left, rect.Top));
'For a given row and col.
Dim rect As Rectangle = Me.grid.RangeInfoToRectangle(GridRangeInfo.Cell(row, col))
Dim screenPoint As Point = Me.grid.PointToScreen(New Point(rect.Left, rect.Top))