Back to Devexpress

PivotCustomFieldValueCellsEventArgsBase.ColumnCount Property

corelibraries-devexpress-dot-xtrapivotgrid-dot-data-dot-pivotcustomfieldvaluecellseventargsbase.md

latest3.1 KB
Original Source

PivotCustomFieldValueCellsEventArgsBase.ColumnCount Property

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

Declaration

csharp
public int ColumnCount { get; }
vb
Public ReadOnly Property ColumnCount As Integer

Property Value

TypeDescription
Int32

An integer value that specifies the number of columns in the pivot grid.

|

Remarks

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

csharp
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

vb
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

RowCount

PivotCustomFieldValueCellsEventArgsBase Class

PivotCustomFieldValueCellsEventArgsBase Members

DevExpress.XtraPivotGrid.Data Namespace