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
65
Bolding Summary Column Based on a Value
posted

I have Xamgrid with a summary row.  For one of  the column summaries (not all), I need to bold it depending on a particular external value.  In other words I need to evaluate the value of the summary cell & compare it to another value and display it bold if they match.  Below is the summary definitions.

Thanks,

 

 

 

 

 

 

 

 

<

 

igDP:FieldLayout.SummaryDefinitions>

 

 

 

 

 

<igDP:SummaryDefinition Key="totAmts" SourceFieldName="Amts" Calculator="Sum"

 

 

StringFormat="{Binding Source={x:Static inf:FormatStrings.Summaryformat}}">

</igDP:SummaryDefinition>

 

 

 

 

<igDP:SummaryDefinition Key="totalacrued" SourceFieldName="acrued" Calculator="Sum"

 

 

StringFormat="{Binding Source={x:Static inf:FormatStrings.Summaryformat}}" TextBlock.TextAlignment="Right"></igDP:SummaryDefinition

>

 

 

 

 

<igDP:SummaryDefinition Key="totNetAmts" SourceFieldName="NetAmts" Calculator="Sum"

 

 

StringFormat="{Binding Source={x:Static inf:FormatStrings.Summaryformat}}" TextBlock.TextAlignment="Right"

 

 

 

>

 

 

 

 

 

 

</igDP:SummaryDefinition>

Parents
No Data
Reply
  • 9836
    posted

    You could create a style for the SummaryResultPresenter and bind the FontWeight property to the value with a custom converter.

    <converter:FontWeightConverter x:Key="boldConverter"/>

    <Style TargetType="{x:Type igDP:SummaryResultPresenter}">

    <Setter Property="TextBlock.FontWeight"

     Value="{Binding Path=Value,

     Converter={StaticResource boldConverter}}" />

    </Style>

     

    public class FontWeightConverter:IValueConverter

        {

            #region IValueConverter Members

     

            public object Convert(object value, Type targetType, object parameter,

    System.Globalization.CultureInfo culture)

            {

                //check the value

                return FontWeights.Bold;

            }

             ..

            #endregion

        }

    Let me know if you have any questions.

Children