DataGridViewRowCollection.GetFirstRow 方法

定义

获取集合中符合指定条件的第一行。Gets the first row in the collection that meets the specified criteria.

重载

GetFirstRow(DataGridViewElementStates)

返回符合指定条件的第一个 DataGridViewRow 的索引。Returns the index of the first DataGridViewRow that meets the specified criteria.

GetFirstRow(DataGridViewElementStates, DataGridViewElementStates)

返回符合指定的包含和排除条件的第一个 DataGridViewRow 的索引。Returns the index of the first DataGridViewRow that meets the specified inclusion and exclusion criteria.

GetFirstRow(DataGridViewElementStates)

返回符合指定条件的第一个 DataGridViewRow 的索引。Returns the index of the first DataGridViewRow that meets the specified criteria.

public:
 int GetFirstRow(System::Windows::Forms::DataGridViewElementStates includeFilter);
public int GetFirstRow (System.Windows.Forms.DataGridViewElementStates includeFilter);
member this.GetFirstRow : System.Windows.Forms.DataGridViewElementStates -> int
Public Function GetFirstRow (includeFilter As DataGridViewElementStates) As Integer

参数

includeFilter
DataGridViewElementStates

DataGridViewElementStates 值的按位组合。A bitwise combination of DataGridViewElementStates values.

返回

具有 includeFilter 所指定特性的第一个 DataGridViewRow 的索引;如果没有找到任何行,则为 -1。The index of the first DataGridViewRow that has the attributes specified by includeFilter; -1 if no row is found.

异常

includeFilter 不是 DataGridViewElementStates 值的有效按位组合。includeFilter is not a valid bitwise combination of DataGridViewElementStates values.

另请参阅

GetFirstRow(DataGridViewElementStates, DataGridViewElementStates)

返回符合指定的包含和排除条件的第一个 DataGridViewRow 的索引。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);
public int GetFirstRow (System.Windows.Forms.DataGridViewElementStates includeFilter, System.Windows.Forms.DataGridViewElementStates excludeFilter);
member this.GetFirstRow : System.Windows.Forms.DataGridViewElementStates * System.Windows.Forms.DataGridViewElementStates -> int
Public Function GetFirstRow (includeFilter As DataGridViewElementStates, excludeFilter As DataGridViewElementStates) As Integer

参数

includeFilter
DataGridViewElementStates

DataGridViewElementStates 值的按位组合。A bitwise combination of DataGridViewElementStates values.

excludeFilter
DataGridViewElementStates

DataGridViewElementStates 值的按位组合。A bitwise combination of DataGridViewElementStates values.

返回

具有 includeFilter 所指定特性,但不具有 excludeFilter 所指定特性的第一个 DataGridViewRow 的索引;如果没有找到任何行,则为 -1。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.

异常

两个指定筛选值之一或二者都不是 DataGridViewElementStates 值的有效按位组合。One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.

另请参阅

适用于