DataGridViewHeaderCell::GetSize Method (Int32)
Gets the size of the cell.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- rowIndex
-
Type:
System::Int32
The row index of the header cell.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The value of the DataGridView property for this cell is null and rowIndex does not equal -1. -or- The value of the OwningColumn property for this cell is not null and rowIndex does not equal -1. -or- The value of the OwningRow property for this cell is not null and rowIndex is less than zero or greater than or equal to the number of rows in the control. -or- The values of the OwningColumn and OwningRow properties of this cell are both null and rowIndex does not equal -1. |
| ArgumentException |
The GetSize method returns the size necessary to fit in a row of column headers if the header cell is a column header, the size necessary to fit in a column of row headers if the header cell is a row header, or the size necessary to be a DataGridViewTopLeftHeaderCell if the cell is a top left header cell.
If the cell is not attached to a DataGridView, the Size property of the DataGridViewHeaderCell returns the value (-1,-1).
Available since 2.0