Share via


IGridProvider.ColumnCount 屬性

定義

取得方格中的資料行總數。

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

屬性值

方格中的資料行總數。

範例

下列範例程式碼會傳回 屬性值。

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

    End Get
End Property

備註

視提供者實作而定,隱藏的資料列和資料行可以在消費者介面自動化樹狀結構中載入,因此會反映在 和 ColumnCount 屬性中 RowCount 。 如果尚未載入隱藏的資料列和資料行,則不會計算。

適用於

另請參閱