Hi,
I tried to create a new style
<Style x:Key="BoldStyleColumnHeader" TargetType="igp:PivotColumnHeaderCellControl"> <Setter Property="FontWeight" Value="Bold"/> </Style>
and apply it to my xamPivotgrid
...
TotalColumnStyle="{StaticResource BoldStyleColumnHeader}"...
but it throws a null reference exception.
Any advice?
Eugene
Hello Eugene,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I suggest you handle the XamPivotGrid’s CellControlAttached event and put the following code in it:
private void pivotGrid_CellControlAttached(object sender, PivotCellControlAttachedEventArgs e) { if (e.Cell.DataColumn.IsTotal) { e.Cell.DataColumn.GridLayout.ColumnHeaderCells[e.Cell.DataColumn.GridLayout.ColumnHeaderCells.Count-2].Style = LayoutRoot.Resources["ColumnHeaderCellStyle"] as Style; } }
Feel free to write me if you have further questions.
Stefan,
It worked!! My users will be very happy!
Thank you.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.