Back to Devexpress

FieldValueCellBase.ValueType Property

corelibraries-devexpress-dot-xtrapivotgrid-dot-data-dot-fieldvaluecellbase-db31c014.md

latest7.3 KB
Original Source

FieldValueCellBase.ValueType Property

Gets the type of the cell.

Namespace : DevExpress.XtraPivotGrid.Data

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

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

Declaration

csharp
public PivotGridValueType ValueType { get; }
vb
Public ReadOnly Property ValueType As PivotGridValueType

Property Value

TypeDescription
PivotGridValueType

A PivotGridValueType enumeration member that specifies the type of the cell.

|

Available values:

NameDescription
Value

Corresponds to a field value.

| | Total |

Corresponds to an automatic total.

| | GrandTotal |

Corresponds to a grand total.

| | CustomTotal |

Corresponds to a custom total.

|

Remarks

The ValueType property defines whether the current cell represents a field value, or it is an automatic total, grand total or custom total column/row header. In the first instance, use the FieldValueCellBase.Value property to obtain the field value.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ValueType 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-dashboard-pivot-custom-export/CS/WinformsExport/Form1.cs#L133

csharp
if(rowName.Contains(cell.Value.ToString().Trim()) &&
  cell.ValueType != PivotGridValueType.Total)
    e.Remove(cell);

winforms-pivot-grid-hide-specific-columns-and-rows/CS/Form1.cs#L37

csharp
if (object.Equals(cell.Value, "Employee B") &&
    cell.ValueType != PivotGridValueType.Total)
    e.Remove(cell);

winforms-pivot-split-field-value-cells/CS/Form1.cs#L31

csharp
new Predicate<FieldValueCell>(delegate(FieldValueCell matchCell) {
return matchCell.ValueType == PivotGridValueType.GrandTotal &&
    matchCell.Field == null;

web-forms-pivot-grid-split-field-value-cells/CS/ASPxPivotGrid_SplittingCells/Default.aspx.cs#L27

csharp
new Predicate<FieldValueCell>(delegate(FieldValueCell matchCell) {
return matchCell.ValueType == PivotGridValueType.GrandTotal &&
    matchCell.Field == null;

web-forms-pivot-grid-hide-particular-rows-and-columns/CS/ASPxPivotGrid_HidingColumnsAndRows/Default.aspx.cs#L33

csharp
if (object.Equals(cell.Value, "Employee B") &&
    cell.ValueType != PivotGridValueType.Total)
    e.Remove(cell);

winforms-dashboard-pivot-custom-export/VB/WinFormsExport/Form1.vb#L138

vb
If rowName.Contains(cell.Value.ToString().Trim()) AndAlso cell.ValueType <> PivotGridValueType.Total Then
    e.Remove(cell)

winforms-pivot-grid-hide-specific-columns-and-rows/VB/Form1.vb#L43

vb
' it is removed with all corresponding rows.
If Object.Equals(cell.Value, "Employee B") AndAlso cell.ValueType <> PivotGridValueType.Total Then
    e.Remove(cell)

winforms-pivot-split-field-value-cells/VB/Form1.vb#L33

vb
' Only cells that match this predicate are split.
Dim condition As New Predicate(Of FieldValueCell)(Function(matchCell As FieldValueCell) matchCell.ValueType =
                                    PivotGridValueType.GrandTotal AndAlso matchCell.Field Is Nothing)

web-forms-pivot-grid-split-field-value-cells/VB/ASPxPivotGrid_SplittingCells/Default.aspx.vb#L28

vb
' Only cells that match this predicate are split.
Dim condition As Predicate(Of FieldValueCell) = New Predicate(Of FieldValueCell)(Function(ByVal matchCell) matchCell.ValueType = PivotGridValueType.GrandTotal AndAlso matchCell.Field Is Nothing)
' Creates a list of cell definitions that represent newly created cells.

web-forms-pivot-grid-hide-particular-rows-and-columns/VB/ASPxPivotGrid_HidingColumnsAndRows/Default.aspx.vb#L32

vb
' it is removed with all corresponding rows.
    If Equals(cell.Value, "Employee B") AndAlso cell.ValueType <> PivotGridValueType.Total Then e.Remove(cell)
Next

See Also

Value

FieldValueCellBase Class

FieldValueCellBase Members

DevExpress.XtraPivotGrid.Data Namespace