Skip to main content

Rank Types

  • 5 minutes to read

Rank summary display types are designed to display ranks of summary values in their columns and rows. To employ rank display values, use RankBinding in Optimized mode.

The following rank types are available:

Rank in a Column: Largest to Smallest

Displays the summary value’s rank among other values in the same column, where the largest value in the column is ranked as 1, and corresponding higher ranks are assigned to all values that are less than the largest value.

pivotgrid_SummaryDisplayType_RankInColumnLargestToSmallest

Example

View Example: PivotGrid for WPF - How to Change SummaryDisplayType in the Context Menu

static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
    BarItem barItem = sender as BarItem;
    object[] barItemInfo = (object[])barItem.Tag;
    PivotGridField field = (PivotGridField)barItemInfo[0];
    FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
    DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
    switch(newValue){
    // ...
        case FieldSummaryDisplayType.RankInColumnLargestToSmallest:
            field.DataBinding = new RankBinding(
                sourceBinding,
                CalculationPartitioningCriteria.ColumnValue,
                RankType.Dense, FieldSortOrder.Descending);
            break;
            // ...
    }
    field.Tag = newValue;
    (field.Parent as PivotGridControl).ReloadData();
}

Rank in a Column: Smallest to Largest

Displays the summary value’s rank among other values in the same column, where the lowest value in the column is ranked as 1 and ranks increase depending on the other values.

pivotgrid_SummaryDisplayType_RankInColumnSmallestToLargest

Example

View Example: PivotGrid for WPF - How to Change SummaryDisplayType in the Context Menu

static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
    BarItem barItem = sender as BarItem;
    object[] barItemInfo = (object[])barItem.Tag;
    PivotGridField field = (PivotGridField)barItemInfo[0];
    FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
    DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
    switch(newValue){
    // ...
        case FieldSummaryDisplayType.RankInColumnSmallestToLargest:
            field.DataBinding = new RankBinding(
                sourceBinding,
                CalculationPartitioningCriteria.ColumnValue,
                RankType.Dense, FieldSortOrder.Ascending);
            break;
            // ...
    }
    field.Tag = newValue;
    (field.Parent as PivotGridControl).ReloadData();
}

Rank in a Row: Largest to Smallest

Displays the summary value’s rank among other values in the same row, where the largest value in the row is ranked as 1, and corresponding higher ranks are assigned to all values that are less than the largest value.

pivotgrid_SummaryDisplayType_RankInRowLargestToSmallest

Example

View Example: PivotGrid for WPF - How to Change SummaryDisplayType in the Context Menu

static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
    BarItem barItem = sender as BarItem;
    object[] barItemInfo = (object[])barItem.Tag;
    PivotGridField field = (PivotGridField)barItemInfo[0];
    FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
    DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
    switch(newValue){
    // ...
        case FieldSummaryDisplayType.RankInRowLargestToSmallest:
            field.DataBinding = new RankBinding(
                sourceBinding,
                CalculationPartitioningCriteria.RowValue,
                RankType.Dense, FieldSortOrder.Descending);
            break;
            // ...
    }
    field.Tag = newValue;
    (field.Parent as PivotGridControl).ReloadData();
}

Rank in a Row: Smallest to Largest

Displays the summary value’s rank among other values in the same row, where the lowest value in the row is ranked as 1, and corresponding higher ranks are assigned to all values that exceed the lowest value.

pivotgrid_SummaryDisplayType_RankInRowSmallestToLargest

Example

View Example: PivotGrid for WPF - How to Change SummaryDisplayType in the Context Menu

static void itemClickEventHandler(object sender, ItemClickEventArgs e) {
    BarItem barItem = sender as BarItem;
    object[] barItemInfo = (object[])barItem.Tag;
    PivotGridField field = (PivotGridField)barItemInfo[0];
    FieldSummaryDisplayType newValue = (FieldSummaryDisplayType)barItemInfo[2];
    DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Value");
    switch(newValue){
    // ...
        case FieldSummaryDisplayType.RankInRowSmallestToLargest:
            field.DataBinding = new RankBinding(
                sourceBinding,
                CalculationPartitioningCriteria.ColumnValue,
                RankType.Dense, FieldSortOrder.Ascending);
            break;
            // ...
    }
    field.Tag = newValue;
    (field.Parent as PivotGridControl).ReloadData();
}
See Also