DataGridViewCell.Size Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the size of the cell.

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

public Size Size { get; }

Property Value

Type: System.Drawing.Size

A Size set to the owning row's height and the owning column's width.

Exception Condition

The row containing the cell is a shared row.


The cell is a column header cell.

If the cell is not associated with a DataGridView control, the Size property returns a Size with a width and height of -1.

.NET Framework
Available since 2.0
Return to top