DataGridViewRowCollection.GetLastRow(DataGridViewElementStates) 方法

定义

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

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

参数

includeFilter
DataGridViewElementStates

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

返回

具有 includeFilter 所指定特性的最后一个 DataGridViewRow 的索引;如果没有找到任何行,则为 -1。The index of the last 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.

适用于

另请参阅