Back to Devexpress

PivotCustomFieldValueCellsEventArgsBase.GetLevelCount(Boolean) Method

corelibraries-devexpress-dot-xtrapivotgrid-dot-data-dot-pivotcustomfieldvaluecellseventargsbase-dot-getlevelcount-x28-system-dot-boolean-x29.md

latest3.0 KB
Original Source

PivotCustomFieldValueCellsEventArgsBase.GetLevelCount(Boolean) Method

Returns the number of column or row levels.

Namespace : DevExpress.XtraPivotGrid.Data

Assembly : DevExpress.PivotGrid.v25.2.Core.dll

NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

csharp
public int GetLevelCount(
    bool isColumn
)
vb
Public Function GetLevelCount(
    isColumn As Boolean
) As Integer

Parameters

NameTypeDescription
isColumnBoolean

true to return the number of column levels; false to return the number of row levels.

|

Returns

TypeDescription
Int32

An integer value that specifies the number of column or row levels.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetLevelCount(Boolean) method.

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#L27

csharp
if (cell == null) continue;
if (cell.EndLevel == e.GetLevelCount(isColumn) - 1) {
    if (IsValueEmpty(isColumn, cell.MaxIndex, e)) {

winforms-pivot-grid-hide-empty-columns-and-rows/VB/Form1.vb#L32

vb
If cell Is Nothing Then Continue For
If cell.EndLevel = e.GetLevelCount(isColumn) - 1 Then
    If IsValueEmpty(isColumn, cell.MaxIndex, e) Then

See Also

PivotCustomFieldValueCellsEventArgsBase Class

PivotCustomFieldValueCellsEventArgsBase Members

DevExpress.XtraPivotGrid.Data Namespace