Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
How can I make Totals headers font bold?
posted

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

 

Parents
  • 138253
    Offline posted

    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.

Reply Children