Skip to main content

PivotCustomFieldValueCellsEventArgs.GetCell(Boolean, Int32) Method

Returns the field value cell by its index.

Namespace: DevExpress.Web.ASPxPivotGrid

Assembly: DevExpress.Web.ASPxPivotGrid.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public FieldValueCell GetCell(
    bool isColumn,
    int index
)

Parameters

Name Type Description
isColumn Boolean

true to obtain the column field value cell; false to obtain the row field value cell.

index Int32

An integer value that specifies the zero-based index of the cell.

Returns

Type Description
FieldValueCell

A FieldValueCell object that represents the required cell; null if the index is out of bounds.

Remarks

Field value cells are indexed in the order shown in the image below:

pivotgrid_FieldValueCellsIndexation

The field value cell can also be located via the PivotCustomFieldValueCellsEventArgs.FindCell method, that returns the cell whose column/row summary values match the specified condition.

Example

The following example demonstrates how to hide particular rows and columns by handling the CustomFieldValueCells event. In this example, the event handler iterates through all row headers and removes rows that correspond to the “Employee B” field value, and that are not Total Rows.

View Example

<dx:ASPxRadioButtonList ID="ASPxRadioButtonList1" runat="server" SelectedIndex="0" AutoPostBack="true" >
    <Items>
        <dx:ListEditItem Text="Default Layout" Value="Default Layout" />
        <dx:ListEditItem Text="Delete All Rows Corresponding to &quot;Employee B&quot;" 
            Value="Delete All Rows Corresponding to &quot;Employee B&quot;" />
    </Items>
</dx:ASPxRadioButtonList>        

<dx:ASPxPivotGrid ID="pivotGrid" runat="server" Width="500px" 
    OnFieldValueDisplayText="pivotGrid_FieldValueDisplayText"
    OnCustomFieldValueCells="pivotGrid_CustomFieldValueCells"
    OptionsCustomization-AllowFilter="false"
    OptionsCustomization-AllowDrag="false">
</dx:ASPxPivotGrid>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetCell(Boolean, Int32) 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.

See Also