IGridProvider.ColumnCount 属性

定义

获取网格中的总列数。

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

属性值

Int32

网格中的总列数。

示例

以下示例代码返回属性值。

/// <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 自动化树中加载,因此将反映在属性ColumnCountRowCount。 如果隐藏的行和列尚未加载,则不会进行计数。

适用于

另请参阅