DataGridViewRowCollection.GetPreviousRow Method

Definition

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

Overloads

GetPreviousRow(Int32, DataGridViewElementStates)

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

GetPreviousRow(Int32, DataGridViewElementStates, DataGridViewElementStates)

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

GetPreviousRow(Int32, DataGridViewElementStates)

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

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

C#
public int GetPreviousRow(int indexStart, System.Windows.Forms.DataGridViewElementStates includeFilter);

Parameters

indexStart
Int32

The index of the row where the method should begin to look for the previous DataGridViewRow.

includeFilter
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values.

Returns

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

Exceptions

indexStart is greater than the number of rows in the collection.

includeFilter is not a valid bitwise combination of DataGridViewElementStates values.

Remarks

The GetPreviousRow(Int32, DataGridViewElementStates) method begins looking for the row that matches the criteria starting with the row positioned before indexStart.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.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, 10

GetPreviousRow(Int32, DataGridViewElementStates, DataGridViewElementStates)

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

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

C#
public int GetPreviousRow(int indexStart, System.Windows.Forms.DataGridViewElementStates includeFilter, System.Windows.Forms.DataGridViewElementStates excludeFilter);

Parameters

indexStart
Int32

The index of the row where the method should begin to look for the previous DataGridViewRow.

includeFilter
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values.

excludeFilter
DataGridViewElementStates

A bitwise combination of DataGridViewElementStates values.

Returns

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

Exceptions

indexStart is greater than the number of rows in the collection.

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

Remarks

The GetPreviousRow(Int32, DataGridViewElementStates, DataGridViewElementStates) method begins looking for the row that matches the criteria starting with the row positioned before indexStart.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.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, 10