DataGridViewRow.State Property

 

Gets the current state of the row.

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

public override DataGridViewElementStates State { get; }

Property Value

Type: System.Windows.Forms.DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values indicating the row state.

Exception Condition
InvalidOperationException

The row is in a DataGridView control and is a shared row.

You cannot use this property with shared rows because shared rows do not store their state locally. To get the state of a shared row, use the GetState method.

.NET Framework
Available since 2.0
Return to top
Show: