corelibraries-devexpress-dot-xtrapivotgrid-dot-data-dot-pivotcustomfieldvaluecellseventargsbase.md
Gets the number of columns in the pivot grid.
Namespace : DevExpress.XtraPivotGrid.Data
Assembly : DevExpress.PivotGrid.v25.2.Core.dll
NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
public int ColumnCount { get; }
Public ReadOnly Property ColumnCount As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the number of columns in the pivot grid.
|
Use the PivotCustomFieldValueCellsEventArgsBase.RowCount property to obtain the number of rows in the pivot grid.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ColumnCount property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-pivot-grid-hide-empty-columns-and-rows/CS/Form1.cs#L41
private bool IsRowEmpty(int rowIndex, PivotCustomFieldValueCellsEventArgs e) {
for (int j = 0; j < e.ColumnCount ; j++) {
decimal value = Convert.ToDecimal(e.GetCellValue(j, rowIndex));
winforms-pivot-grid-hide-empty-columns-and-rows/VB/Form1.vb#L49
Private Function IsRowEmpty(ByVal rowIndex As Integer, ByVal e As PivotCustomFieldValueCellsEventArgs) As Boolean
For j As Integer = 0 To e.ColumnCount - 1
Dim value As Decimal = Convert.ToDecimal(e.GetCellValue(j, rowIndex))
See Also
PivotCustomFieldValueCellsEventArgsBase Class