DataGridViewRowCollection.GetFirstRow Method

Definition

Gets the first row in the collection that meets the specified criteria.

Overloads

GetFirstRow(DataGridViewElementStates)

Returns the index of the first DataGridViewRow that meets the specified criteria.

GetFirstRow(DataGridViewElementStates, DataGridViewElementStates)

Returns the index of the first DataGridViewRow that meets the specified inclusion and exclusion criteria.

GetFirstRow(DataGridViewElementStates)

Source:
DataGridViewRowCollection.cs
Source:
DataGridViewRowCollection.cs
Source:
DataGridViewRowCollection.cs

Returns the index of the first DataGridViewRow that meets the specified criteria.

public int GetFirstRow(System.Windows.Forms.DataGridViewElementStates includeFilter);

Parameters

includeFilter
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values.

Returns

The index of the first DataGridViewRow that has the attributes specified by includeFilter; -1 if no row is found.

Exceptions

includeFilter is not a valid bitwise combination of DataGridViewElementStates values.

See also

Applies to

.NET Framework 4.8.1 およびその他のバージョン
製品 バージョン
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GetFirstRow(DataGridViewElementStates, DataGridViewElementStates)

Source:
DataGridViewRowCollection.cs
Source:
DataGridViewRowCollection.cs
Source:
DataGridViewRowCollection.cs

Returns the index of the first DataGridViewRow that meets the specified inclusion and exclusion criteria.

public int GetFirstRow(System.Windows.Forms.DataGridViewElementStates includeFilter, System.Windows.Forms.DataGridViewElementStates excludeFilter);

Parameters

includeFilter
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values.

excludeFilter
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values.

Returns

The index of the first DataGridViewRow that has the attributes specified by includeFilter, and does not have the attributes specified by excludeFilter; -1 if no row is found.

Exceptions

One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.

See also

Applies to

.NET Framework 4.8.1 およびその他のバージョン
製品 バージョン
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9