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
120
Row ForeGround
posted

 Hi,

I am trying to Change ForeColor of EverycellText when row is getting selected.How it is Possible.

Thanks 

  • 4850
    Offline posted

    You can do this with style triggers. The following example shows how to define a Style for CellValuePresenter that triggers off the DataRecord's IsSelected and IsActive properties The reason the simple Binding statement works is that the DataComtext is the DataRecord. e.g.:

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

    <Style.Triggers>

    <DataTrigger Binding="{Binding Path=IsSelected}" Value="True">

    <Setter Property="Foreground" Value="Orange"/>

    </DataTrigger>

    <DataTrigger Binding="{Binding Path=IsActive}" Value="True">

    <Setter Property="Foreground" Value="Red"/>

    </DataTrigger>

    </Style.Triggers>