Class PivotValueSortSettings
Provides options to sort individual value fields and their aggregated values along the row or column axis in ascending or descending order.
Inheritance
Namespace: Syncfusion.Blazor.PivotView
Assembly: Syncfusion.Blazor.dll
Syntax
public class PivotValueSortSettings : OwningComponentBase
Constructors
PivotValueSortSettings()
Declaration
public PivotValueSortSettings()
Properties
ColumnHeaderText
Gets or sets the header text of the column field for which value-based sorting is applied.
Declaration
public string ColumnHeaderText { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
This property is applicable only for relational data sources.
For example, set this property to "FY 2018.Units Sold" to sort the values corresponding to that column field.
Ensure that EnableValueSorting is set to true in either the SfPivotView or SfPivotFieldList component.
Examples
The following example demonstrates how to use the ColumnHeaderText property in the SfPivotView component:
@using Syncfusion.Blazor.PivotView
<SfPivotView TValue="ProductDetails" EnableValueSorting="true">
<PivotViewDataSourceSettings DataSource="@dataSource">
<PivotViewColumns>
<PivotViewColumn Name="Year"></PivotViewColumn>
</PivotViewColumns>
<PivotViewValues>
<PivotViewValue Name="Sold" Caption="Units Sold"></PivotViewValue>
<PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
</PivotViewValues>
<PivotViewValueSortSettings ColumnHeaderText="FY 2018.Units Sold" ColumnSortOrder="Sorting.Descending"></PivotViewValueSortSettings>
</PivotViewDataSourceSettings>
</SfPivotView>
The following example demonstrates usage in the SfPivotFieldList component:
@using Syncfusion.Blazor.PivotView
<SfPivotFieldList TValue="ProductDetails" EnableValueSorting="true">
<PivotFieldListDataSourceSettings DataSource="@dataSource">
<PivotFieldListColumns>
<PivotFieldListColumn Name="Year"></PivotFieldListColumn>
</PivotFieldListColumns>
<PivotFieldListValues>
<PivotFieldListValue Name="Sold" Caption="Units Sold"></PivotFieldListValue>
<PivotFieldListValue Name="Amount" Caption="Sold Amount"></PivotFieldListValue>
</PivotFieldListValues>
<PivotFieldListValueSortSettings ColumnHeaderText="FY 2018.Units Sold" ColumnSortOrder="Sorting.Descending"></PivotFieldListValueSortSettings>
</PivotFieldListDataSourceSettings>
</SfPivotFieldList>
ColumnSortOrder
Gets or sets the sort order to apply for the specified column field.
Declaration
public Sorting ColumnSortOrder { get; set; }
Property Value
| Type | Description |
|---|---|
| Sorting | A Sorting enum value indicating the sort direction: |
Remarks
Only supported in relational data sources. Use string values like "Sorting.Descending" in Razor syntax due to enum serialization.
Ensure EnableValueSorting is enabled.
Examples
See ColumnHeaderText example for code samples using this property.
HeaderDelimiter
It allows to set the delimiter, which is used a separator to split the given header text.
Declaration
public string HeaderDelimiter { get; set; }
Property Value
| Type |
|---|
| System.String |
HeaderText
It allows to set the member name of a specific field for value sorting.
It is applicable only for OLAP data source. For relational data source use ColumnHeaderText and RowHeaderText properties.
Declaration
public string HeaderText { get; set; }
Property Value
| Type |
|---|
| System.String |
Measure
It allows to set the measure name to achieve value sorting based on this.
Declaration
public string Measure { get; set; }
Property Value
| Type |
|---|
| System.String |
RowHeaderText
Gets or sets the header text of the row field for which value-based sorting is applied.
Declaration
public string RowHeaderText { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
This property is applicable only for relational data sources.
For example, set this property to "Germany" to sort the values corresponding to that row field.
Ensure that EnableValueSorting is set to true in either the SfPivotView or SfPivotFieldList component.
Examples
The following example demonstrates how to use the RowHeaderText property in the SfPivotView component:
@using Syncfusion.Blazor.PivotView
<SfPivotView TValue="ProductDetails" EnableValueSorting="true">
<PivotViewDataSourceSettings DataSource="@dataSource">
<PivotViewRows>
<PivotViewRow Name="Country"></PivotViewRow>
</PivotViewRows>
<PivotViewValueSortSettings RowHeaderText="Germany" RowSortOrder="Sorting.Ascending"></PivotViewValueSortSettings>
</PivotViewDataSourceSettings>
</SfPivotView>
The following example demonstrates usage in the SfPivotFieldList component:
@using Syncfusion.Blazor.PivotView
<SfPivotFieldList TValue="ProductDetails" EnableValueSorting="true">
<PivotFieldListDataSourceSettings DataSource="@dataSource">
<PivotFieldListRows>
<PivotFieldListRow Name="Country"></PivotFieldListRow>
</PivotFieldListRows>
<PivotFieldListValueSortSettings RowHeaderText="Germany" RowSortOrder="Sorting.Ascending"></PivotFieldListValueSortSettings>
</PivotFieldListDataSourceSettings>
</SfPivotFieldList>
RowSortOrder
Gets or sets the sort order to apply for the specified row field.
Declaration
public Sorting RowSortOrder { get; set; }
Property Value
| Type | Description |
|---|---|
| Sorting | A Sorting enum value indicating the sort direction: |
Remarks
Only supported in relational data sources. Use string values like "Sorting.Ascending" in Razor syntax due to enum serialization.
Ensure EnableValueSorting is enabled.
Examples
See RowHeaderText example for code samples using this property.
SortOrder
Allows to apply sorting to the specified field either by ascending or descending. The types are,
Ascending: It allows to display the field members in ascending order.
Descending: It allows to display the field members in descending order.
It is applicable only for OLAP data source. For relational data source use ColumnSortOrder and RowSortOrder properties.
Declaration
public Sorting SortOrder { get; set; }
Property Value
| Type |
|---|
| Sorting |