DataGridViewRow.Selected Property

 

Gets or sets a value indicating whether the row is selected.

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

override Selected : bool with get, set

Property Value

Type: System.Boolean

true if the row is selected; otherwise, false.

Exception Condition
InvalidOperationException

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

You cannot use this property with a shared row. For more information about shared rows, see Best Practices for Scaling the Windows Forms DataGridView Control.

The following code example illustrates the use of this property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: