windowsforms-10915-controls-and-libraries-pivot-grid-data-shaping-summarization-summaries-summary-display-types-rank-types.md
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:
The summary value’s rank in its 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.
void ItemClick(object sender, EventArgs e) {
// ...
PivotGridField field = item.Tag as PivotGridField;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Number");
PivotSummaryDisplayType newValue = (PivotSummaryDisplayType)Enum.Parse(typeof(PivotSummaryDisplayType),
item.Caption);
switch(newValue) {
// ...
case PivotSummaryDisplayType.RankInColumnLargestToSmallest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, PivotSortOrder.Descending);
break;
// ...
}
field.Tag = newValue;
}
Private Sub ItemClick(ByVal sender As Object, ByVal e As EventArgs)
' ...
Dim field As PivotGridField = TryCast(item.Tag, PivotGridField)
Dim sourceBinding As New DataSourceColumnBinding("Number")
Dim newValue As PivotSummaryDisplayType = DirectCast(System.Enum.Parse(GetType(PivotSummaryDisplayType),
item.Caption), PivotSummaryDisplayType)
Select Case newValue
' ...
Case PivotSummaryDisplayType.RankInColumnLargestToSmallest
field.DataBinding = New RankBinding(sourceBinding, CalculationPartitioningCriteria.ColumnValue, RankType.Dense, PivotSortOrder.Descending)
' ...
End Select
field.Tag = newValue
End Sub
Note
Set PivotGridFieldBase.SummaryDisplayType to RankInColumnLargestToSmallest in Legacy, LegacyOptimized, and OLAP modes.
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.
void ItemClick(object sender, EventArgs e) {
// ...
PivotGridField field = item.Tag as PivotGridField;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Number");
PivotSummaryDisplayType newValue = (PivotSummaryDisplayType)Enum.Parse(typeof(PivotSummaryDisplayType),
item.Caption);
switch(newValue) {
// ...
case PivotSummaryDisplayType.RankInColumnSmallestToLargest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, PivotSortOrder.Ascending);
break;
// ...
}
field.Tag = newValue;
}
Private Sub ItemClick(ByVal sender As Object, ByVal e As EventArgs)
' ...
Dim field As PivotGridField = TryCast(item.Tag, PivotGridField)
Dim sourceBinding As New DataSourceColumnBinding("Number")
Dim newValue As PivotSummaryDisplayType = DirectCast(System.Enum.Parse(GetType(PivotSummaryDisplayType),
item.Caption), PivotSummaryDisplayType)
Select Case newValue
' ...
Case PivotSummaryDisplayType.RankInColumnSmallestToLargest
field.DataBinding = New RankBinding(sourceBinding, CalculationPartitioningCriteria.ColumnValue, RankType.Dense, PivotSortOrder.Ascending)
' ...
End Select
field.Tag = newValue
End Sub
Note
Set PivotGridFieldBase.SummaryDisplayType to RankInColumnSmallestToLargest in Legacy, LegacyOptimized, and OLAP modes.
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.
void ItemClick(object sender, EventArgs e) {
// ...
PivotGridField field = item.Tag as PivotGridField;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Number");
PivotSummaryDisplayType newValue = (PivotSummaryDisplayType)Enum.Parse(typeof(PivotSummaryDisplayType),
item.Caption);
switch(newValue) {
// ...
case PivotSummaryDisplayType.RankInRowLargestToSmallest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.RowValue,
RankType.Dense, PivotSortOrder.Descending);
break;
// ...
}
field.Tag = newValue;
}
Private Sub ItemClick(ByVal sender As Object, ByVal e As EventArgs)
' ...
Dim field As PivotGridField = TryCast(item.Tag, PivotGridField)
Dim sourceBinding As New DataSourceColumnBinding("Number")
Dim newValue As PivotSummaryDisplayType = DirectCast(System.Enum.Parse(GetType(PivotSummaryDisplayType),
item.Caption), PivotSummaryDisplayType)
Select Case newValue
' ...
Case PivotSummaryDisplayType.RankInRowLargestToSmallest
field.DataBinding = New RankBinding(sourceBinding, CalculationPartitioningCriteria.RowValue, RankType.Dense, PivotSortOrder.Descending)
' ...
End Select
field.Tag = newValue
End Sub
Note
Set PivotGridFieldBase.SummaryDisplayType to RankInRowLargestToSmallest in Legacy, LegacyOptimized, and OLAP modes.
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.
void ItemClick(object sender, EventArgs e) {
// ...
PivotGridField field = item.Tag as PivotGridField;
DataSourceColumnBinding sourceBinding = new DataSourceColumnBinding("Number");
PivotSummaryDisplayType newValue = (PivotSummaryDisplayType)Enum.Parse(typeof(PivotSummaryDisplayType),
item.Caption);
switch(newValue) {
// ...
case PivotSummaryDisplayType.RankInRowSmallestToLargest:
field.DataBinding = new RankBinding(
sourceBinding,
CalculationPartitioningCriteria.ColumnValue,
RankType.Dense, PivotSortOrder.Ascending);
break;
// ...
}
field.Tag = newValue;
}
Private Sub ItemClick(ByVal sender As Object, ByVal e As EventArgs)
' ...
Dim field As PivotGridField = TryCast(item.Tag, PivotGridField)
Dim sourceBinding As New DataSourceColumnBinding("Number")
Dim newValue As PivotSummaryDisplayType = DirectCast(System.Enum.Parse(GetType(PivotSummaryDisplayType),
item.Caption), PivotSummaryDisplayType)
Select Case newValue
' ...
Case PivotSummaryDisplayType.RankInRowSmallestToLargest
field.DataBinding = New RankBinding(sourceBinding, CalculationPartitioningCriteria.ColumnValue, RankType.Dense, PivotSortOrder.Ascending)
' ...
End Select
field.Tag = newValue
End Sub
Note
Set PivotGridFieldBase.SummaryDisplayType to RankInRowSmallestToLargest in Legacy, LegacyOptimized, and OLAP modes.
See Also