DataGrid::GetCellBounds Method (DataGridCell)

 

Gets the Rectangle of the cell specified by DataGridCell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
Rectangle GetCellBounds(
	DataGridCell dgc
)

Parameters

dgc
Type: System.Windows.Forms::DataGridCell

The DataGridCell to look up.

Return Value

Type: System.Drawing::Rectangle

A Rectangle that defines the current cell's corners.

The following code example uses the GetCellBounds method to return a Rectangle of a specified cell.

protected:
   DataGridCell dgc;

   void GetRect()
   {
      Rectangle rect;
      dgc.ColumnNumber = 0;
      dgc.RowNumber = 0;
      rect = dataGrid1->GetCellBounds( dgc );
      Console::WriteLine( rect );
   }

.NET Framework
Available since 1.1
Return to top
Show: