Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RankBinding Class

Defines the calculation of a ranking in the window.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.2.dll

NuGet Package: DevExpress.Win.PivotGrid

#Declaration

public class RankBinding :
    RankBindingBase

#Remarks

Follow the steps listed below to bind a PivotGrid field to the result of the calculation in Optimized mode.

  1. Create an instance of the RankBinding class.
  2. Set the Source property to the DataBindingBase descendant instance.
  3. Specify the window frame.
  4. Assign the RankBinding instance to the PivotGridField.DataBinding property.

#Example

Filter and Search

The following code snippet illustrates the use of the Data Binding API to calculate a rank for each value in the column in a pivot field group:

Run Demo: Optimized Mode - Field Calculation Bindings

public static void PivotCalculations(PivotGridControl pivotGridControl) {                        
    DataSourceColumnBinding productAmountBinding = new DataSourceColumnBinding("ExtendedPrice");
    //Calculate a rank for each value in the column in a pivot field group.
    pivotGridControl.Fields["fRank"].DataBinding = new RankBinding(
        productAmountBinding, CalculationPartitioningCriteria.ColumnValueAndRowParentValue, RankType.Unique, PivotSortOrder.Descending);
}
See Also