Skip to main content

PercentOfTotalBinding Class

Allows you to calculate the input of all values in the window as a percentage of the total.

Namespace: DevExpress.Web.ASPxPivotGrid

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

Declaration

public class PercentOfTotalBinding :
    PercentOfTotalBindingBase

Remarks

Do the following to bind a Pivot Grid field to the result of the Percent of Total window calculation:

  1. Create an instance of the PercentOfTotalBinding class with the Source property set to the DataBindingBase descendant instance.
  2. Specify the window frame.
  3. Assign the PercentOfTotalBinding instance to the PivotGridFieldBase.DataBinding property.

The example below shows how to use PercentOfTotalBinding to display the percentage of total sales in the Pivot Grid.

View Example

[!codesnippet-csharp[dx-examples](aspxpivotgrid-field-calculation-bindings/CS/AspNetWebFormsPivotFieldCalculationBindings/Default.aspx?line=29-38)]
<dx:PivotGridField ID="PercentOfTotal" Area="DataArea" AreaIndex="0"  Name="PercentOfTotal">
    <DataBindingSerializable>
        <dx:PercentOfTotalBinding PartitioningCriteria="ColumnValue">
            <SourceSerializable>
                <dx:DataSourceColumnBinding ColumnName="Extended_Price" />
            </SourceSerializable>
            </dx:PercentOfTotalBinding>
    </DataBindingSerializable>
    <CellFormat FormatString= "p" FormatType= "Numeric" ></CellFormat>
</dx:PivotGridField>

See the following topic for more information: Data Binding API.

Implements

DevExpress.XtraPivotGrid.IDesignerContextProvider
See Also