Skip to main content

PivotCustomDrawCellBaseEventArgs.GetCellValue(Object[], Object[], PivotGridField) Method

Returns a cell value calculated for the specified column and row field values, against the specified data field.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.1.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public object GetCellValue(
    object[] columnValues,
    object[] rowValues,
    PivotGridField dataField
)

Parameters

Name Type Description
columnValues Object[]

An array of column values.

rowValues Object[]

An array of row values.

dataField PivotGridField

A PivotGridField object that specifies the data field, against which the required cell value is calculated.

Returns

Type Description
Object

A summary value calculated for the specified column and row field values, against the specified data field.

Remarks

The GetCellValue method returns null (Nothing in Visual Basic) in the following instances:

  • the specified field is null (Nothing in Visual Basic);
  • the specified field is not a Data Field;
  • the specified field is hidden (its PivotGridFieldBase.Visible property is set to false).

Consider the pivot grid displayed in the image below.

GetCellValue

The following table illustrates how to use the GetCellValue method to obtain specific cell values.

Cell C# Visual Basic
Red e.GetCellValue(new object[] {1995, 3}, new object[] {"Alice Mutton"}, fieldProductAmount); e.GetCellValue(New Object() {1995, 3}, New Object() {"Alice Mutton"}, fieldProductAmount)
Green e.GetCellValue(new object[] {1995}, new object[] {"Aniseed Syrup"}, fieldProductAmount); e.GetCellValue(New Object() {1995}, New Object() {"Aniseed Syrup"}, fieldProductAmount)
Blue e.GetCellValue(null, new object[] {"Boston Crab Meat"}, fieldProductAmount); e.GetCellValue(Nothing, New Object() {"Boston Crab Meat"}, fieldProductAmount)

Note

If you call the GetCellValue method while an asynchronous operation is being performed, an exception will be thrown. To determine whether the operation is in progress, use the pivot grid’s IThreadSafeAccessible.IsAsyncInProgress property. For more information, see Asynchronous Mode.

See Also