PivotCustomFieldValueCellsEventArgs.Split(Boolean, Predicate<FieldValueCell>, Boolean, FieldValueSplitData[]) Method

Splits all field value cells that match the specified condition, or only the first matching cell.

Namespace: DevExpress.Web.ASPxPivotGrid

Assembly: DevExpress.Web.ASPxPivotGrid.v20.1.dll

Declaration

public void Split(
    bool isColumn,
    Predicate<FieldValueCell> match,
    bool firstCellOnly,
    params FieldValueSplitData[] cells
)
Public Sub Split(
    isColumn As Boolean,
    match As Predicate(Of FieldValueCell),
    firstCellOnly As Boolean,
    ParamArray cells As FieldValueSplitData()
)

Parameters

Name Type Description
isColumn Boolean

true to process column field value cells; false to process row field value cells.

match Predicate<FieldValueCell>

A System.Predicate that represents the condition used to define which cells should be split.

firstCellOnly Boolean

true to split only the first cell that matches the specified condition; false to split all cells that match the condition.

cells FieldValueSplitData[]

The FieldValueSplitData objects that define how to split the cells.

Remarks

The Split method cannot split a field value cell if it has only one nested cell, or has none.

To split a cell (or several cells), create a System.Predicate<FieldValueCell> delegate that defines which cells should be split, and pass it as the match parameter. You should also create a set of FieldValueSplitData objects. Each of them identifies a single new cell, from the leftmost to the rightmost (for the column cells), or from the topmost to the bottommost (for the row cells). Specify the size and values of the new cells using the FieldValueSplitData.NestedCellCount and FieldValueSplitData.Value properties, respectively, and pass the created objects as the cells parameter. The FieldValueSplitData.NestedCellCount property defines the size of a newly created cell by specifying the number of cells nested in it.

pivotgrid_SplitData

Examples

The following example demonstrates how to split field value cells. In this example, the Grand Total column header is split into two cells: Price and Count. To do this, handle the CustomFieldValueCells event and use the event parameter's Split method. Cells that should be split are identified by a predicate that returns true for those cells. The quantity, size and captions of newly created cells are specified by an array of cell definitions (the FieldValueSplitData objects).

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
    Inherits="ASPxPivotGrid_SplittingCells._Default" %>
<%@ Register Assembly="DevExpress.Web.ASPxPivotGrid.v10.2, Version=10.2.0.0,
    Culture=neutral, PublicKeyToken=79868b8147b5eae4"
    Namespace="DevExpress.Web.ASPxPivotGrid"
    TagPrefix="dx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:RadioButtonList ID="radioButtonList" runat="server"
            AutoPostBack="true" CellSpacing="10" >
            <asp:ListItem Selected="True">Default Layout</asp:ListItem>
            <asp:ListItem>Split Grand Total Column Header</asp:ListItem>
        </asp:RadioButtonList>
        <br />
        <div>
            <dx:ASPxPivotGrid ID="pivotGrid" runat="server" Width="500px" 
                OnFieldValueDisplayText="pivotGrid_FieldValueDisplayText"
                OnCustomFieldValueCells="pivotGrid_CustomFieldValueCells"
                OptionsCustomization-AllowFilter="False"
                OptionsCustomization-AllowDrag="False">
            </dx:ASPxPivotGrid>
        </div>
    </form>    
</body>

</html>
See Also