This is a migrated thread and some comments may be shown as answers.

Trying to change Background color of TextBox within RadComboBox

1 Answer 329 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 28 Nov 2016, 08:24 PM

I am trying to color the Background of the TextBox within the RadComoboBox to be Pink is the search typed in fails.

<Style TargetType="TextBox" x:Key="CustomComboTextBoxStyle"  >
    <Style.Triggers>
        <DataTrigger Binding="{Binding SearchFailed}" Value="true">
            <Setter Property="Background" Value="LightPink" />
        </DataTrigger>
        <DataTrigger Binding="{Binding SearchFailed}" Value="false">
            <Setter Property="Background" Value="White" />
        </DataTrigger>
    </Style.Triggers>
</Style>

 

When I run, the SearchFailed is false and the background is white and that appears to work.  But when SearchFailed is true, the background does not change.

public bool SearchFailed
{
    get { return _searchFailed; }
    set
    {
        _searchFailed = value;
        NotifyPropertyChanged( "SearchFailed" );
    }
}

Is there something I need to do to tell the RadComboBox to update?

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 28 Nov 2016, 09:36 PM
I solved but adding NotifyOnSourceUpdated=True on BOTH not just one.
Tags
ComboBox
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or