Back to Devexpress

PivotCellValueEventArgs.Value Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotcellvalueeventargs.md

latest6.1 KB
Original Source

PivotCellValueEventArgs.Value Property

Gets or sets the processed cell’s value.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public object Value { get; set; }
vb
Public Property Value As Object

Property Value

TypeDescription
Object

An object which represents the processed cell’s value.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Value 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-access-other-cell-value-while-calculating-the-current-cell/CS/WinAppCustomCellValue/Form1.cs#L29

csharp
if (e.RowValueType == PivotGridValueType.GrandTotal) {
    e.Value = null;
    return;

winforms-dashboard-access-api-of-underlying-controls/CS/Dashboard_ControlAccess/Form1.cs#L24

csharp
void pivotGridControl_CustomCellValue(object sender, PivotCellValueEventArgs e) {
    if (e.Value != null && (decimal)e.Value < 2000)
        e.Value = "Too low to show";

winforms-pivotgrid-how-to-edit-and-save-cell-values/CS/HowToEditAndSavePivotCellValues/Form1.cs#L28

csharp
private void PivotGridControl1_CustomCellValue(object sender, DevExpress.XtraPivotGrid.PivotCellValueEventArgs e) {
    if (e.DataField.Name == "fieldNeedVerification" && e.Value != null) {
        e.Value = (Convert.ToInt32(e.Value) > 0) ? true : false;

winforms-pivotgrid-assign-in-place-editors-to-different-types-of-cells/CS/PivotGridControl_CustomCellEdit/Form1.cs#L35

csharp
if (e.DataField == fieldQuantityPercent)
        e.Value = Convert.ToDecimal(e.Value) * 100;
}

winforms-pivot-grid-override-in-place-cell-editor/CS/PivotGridControl_CustomCellEdit/Form1.cs#L32

csharp
if (e.DataField == fieldQuantityPercent)
        e.Value = Math.Round(Convert.ToDecimal(e.Value) * 100, 2);
}

winforms-pivot-access-other-cell-value-while-calculating-the-current-cell/VB/WinAppCustomCellValue/Form1.vb#L26

vb
If e.RowValueType = PivotGridValueType.GrandTotal Then
    e.Value = Nothing
    Return

winforms-dashboard-access-api-of-underlying-controls/VB/Dashboard_ControlAccess/Form1.vb#L25

vb
Private Sub pivotGridControl_CustomCellValue(ByVal sender As Object, ByVal e As PivotCellValueEventArgs)
    If e.Value IsNot Nothing AndAlso DirectCast(e.Value, Decimal) < 2000 Then
        e.Value = "Too low to show"

winforms-pivotgrid-how-to-edit-and-save-cell-values/VB/HowToEditAndSavePivotCellValues/Form1.vb#L34

vb
Private Sub PivotGridControl1_CustomCellValue(ByVal sender As Object, ByVal e As DevExpress.XtraPivotGrid.PivotCellValueEventArgs)
    If e.DataField.Name = "fieldNeedVerification" AndAlso e.Value IsNot Nothing Then
        e.Value = If(Convert.ToInt32(e.Value) > 0, True, False)

winforms-pivotgrid-assign-in-place-editors-to-different-types-of-cells/VB/PivotGridControl_CustomCellEdit/Form1.vb#L42

vb
If e.DataField Is fieldQuantity Then
    e.Value = Convert.ToDecimal(e.Value) * 100
End If

winforms-pivot-grid-override-in-place-cell-editor/VB/PivotGridControl_CustomCellEdit/Form1.vb#L44

vb
If e.DataField Is fieldQuantity Then
    e.Value = Math.Round(Convert.ToDecimal(e.Value) * 100, 2)
End If

See Also

PivotCellValueEventArgs Class

PivotCellValueEventArgs Members

DevExpress.XtraPivotGrid Namespace