語言

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

備註

根據提供者實作不同,隱藏的列與欄可以載入 UI 自動化樹,並反映在 RowCount and ColumnCount 屬性中。 如果隱藏的列和欄尚未載入,則不會被計算。

適用於

另請參閱