public class Salary { public DateTimeOffset Date { get; set; } public string Name { get; set; } //Can be Luca or Katya public decimal Money { get; set; } }
Date |
Luca |
Katya |
15-Jan-2016 | $2,868.76 | $1,970.31 |
31-Jan-2016 | $3,316.98 | $1,970.31 |
15-Feb-2016 | $3,225.53 | $1,970.31 |
29-Feb-2016 | $3,281.57 | $1,970.31 |
15-Mar-2016 | $3,316.98 | $1,970.31 |
31-Mar-2016 | $3,316.98 | $1,970.31 |
<Style TargetType="syncfusion:GridRowHeaderCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="syncfusion:GridRowHeaderCell">
<Border x:Name="PART_RowHeaderCellBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding DateofBirth}"
TextAlignment="Center" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> |
<syncfusion:SfDataGrid x:Name="sfGrid"
Grid.Row="1"
FrozenColumnCount="1"
AllowEditing="True"
AutoGenerateColumns="False"
GridValidationMode="InView"
ItemsSource="{Binding UserDetails}"
ShowRowHeader="True"/> |
#XAML
<Page
x:Class="CustomRelationalSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CustomRelationalSample"
xmlns:pivotGrid="using:Syncfusion.UI.Xaml.PivotGrid"
xmlns:pivots="using:Syncfusion.PivotAnalysis.UWP"
xmlns:viewModel="using:CustomRelationalSample.ViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.DataContext>
<viewModel:ViewModel/>
</Grid.DataContext>
<pivotGrid:SfPivotGrid Name="pivotGrid1" AllowSelection="True" ItemSource="{Binding ProductSalesData}" Margin="11">
<pivotGrid:SfPivotGrid.PivotRows>
<pivots:PivotItem FieldCaption="Date" FieldMappingName="Date" Format="dd/MM/yy" TotalHeader="Total"/>
</pivotGrid:SfPivotGrid.PivotRows>
<pivotGrid:SfPivotGrid.PivotColumns>
<pivots:PivotItem FieldCaption="Name" FieldMappingName="Name" TotalHeader="Total"/>
</pivotGrid:SfPivotGrid.PivotColumns>
<pivotGrid:SfPivotGrid.PivotCalculations>
<pivots:PivotComputationInfo FieldCaption="Money" FieldName="Money" Format="C" SummaryType="DecimalTotalSum" />
</pivotGrid:SfPivotGrid.PivotCalculations>
</pivotGrid:SfPivotGrid>
</Grid>
</Page> |
API |
Description |
Type |
ItemSource |
ItemSource property that helps you to bind the relational data source to SfPivotGrid. |
object |
PivotRows |
Collection of PivotItem that holds the information of row fields of SfPivotGrid |
PivotItem |
PivotColumns |
Collection of PivotItem that holds the information of column fields of SfPivotGrid |
PivotItem |
PivotCalculations |
Collection of PivotComputationInfo that holds the information of value fields of SfPivotGrid |
PivotComputationInfo |