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
900
Styling a Label based on a field's filter
posted

Hi,

I'd like to know if it's possible to style the label (change its background color for example) based on the fact if the field has a filter applied to it or not.

I'm trying the following:

private void OnRecordFilterChanged(object sender, RecordFilterChangedEventArgs e)
{
     if (0 < e.RecordFilter.Conditions.Count)
     {
           e.RecordFilter.Field.Settings.LabelPresenterStyle = myFilterLabelStyle;
     }
}
       

My style looks like this:
<Style x:Key="myFilterLabelStyleKey" TargetType="{x:Type igDP:LabelPresenter}">
    <Setter Property="Background" Value="Yellow" />
</Style>

In the debugger, I can see the style being set, however there is no effect on the screen.  Nothing happens.  My grid is also using the Office2010Blue theme.  I tried disabling it, and still no effect from this logic.

How can I get this to work?

Thanks