is there a way to show cell data divided by a value ?
p.e /100
Hello ipappous,
I have been looking into your requirements and in order to fulfill them I can suggest you add a style for the PivotCellControl and manually convert the shown text in the cells. You can achieve this for example by adding the following style for the PivotCellControl:
<Style TargetType="ig:PivotCellControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ig:PivotCellControl">
<Grid>
<Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}" />
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Name="cellPresenter" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Cell, Converter={StaticResource con}}"
Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
And convert the value as follows:
public class FormatValueConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
if (value != null)
PivotCell pCell = (value as PivotCell);
ICell cell = pCell.Data as ICell;
if (cell != null&& cell.Value is double)
return (double)cell.Value / 100;
}
return "";
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
#endregion
If you need any further assistance on this matter, please do not hesitate to ask.