Category / Section
How to define pivotItem comparer in xaml
1 min read
We would like to let you know that we can define the PivotItem Comparer in xaml through following the below mentioned procedure:
- Create the class ReverseOrderComparer.
2) Include the namespace of the class in xaml file.
XAML
xmlns:local="clr-namespace:[Name of the namespace]"
3) Add ReverseOrderComparer class as a resource through defining a key using <Grid.Resources/>
XAML
<Grid.Resources> <local:ReverseOrderComparer x:Key="reverseOrderComparer"/> </Grid.Resources>
4) Add the Comparer attribute to the pivotItem that you want to compare and call the created object as StaticResource.
XAML
<syncfusion:PivotItem AllowRunTimeGroupByField="True" FieldMappingName="Name" TotalHeader="" Comparer="{StaticResource reverseOrderComparer}"/>