IGridProvider.RowCount 屬性

定義

取得方格的資料列總數。Gets the total number of rows in a grid.

public:
 property int RowCount { int get(); };
public int RowCount { get; }
member this.RowCount : int
Public ReadOnly Property RowCount As Integer

屬性值

Int32

方格的資料列總數。The total number of rows in a grid.

範例

下列範例程式碼會傳回屬性值。The following example code returns the property value.

/// <summary>
/// Gets the count of rows in the grid.
/// </summary>
/// <remarks>
/// gridItems is a two-dimensional array containing rows in
/// the first dimension.
/// </remarks>
int IGridProvider.RowCount
{
    get 
    {
        return gridItems.GetUpperBound(0) + 1;  
    }
}
''' <summary>
''' Gets the count of rows in the grid.
''' </summary>
''' <remarks>
''' gridItems is a two-dimensional array containing rows in
''' the first dimension.
''' </remarks>
Private ReadOnly Property RowCount() As Integer Implements IGridProvider.RowCount
    Get
        Return gridItems.GetUpperBound(0) + 1
    End Get
End Property

備註

隱藏的資料列和資料行(視提供者的執行而定)可以載入邏輯樹狀結構中,因此會反映在 RowCountColumnCount 屬性中。Hidden rows and columns, depending on the provider implementation, can be loaded in the logical tree and will therefore be reflected in the RowCount and ColumnCount properties. 如果隱藏的資料列和資料行尚未載入,就不會加以計算。If the hidden rows and columns have not yet been loaded they will not be counted.

適用於