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
505
How to apply Foreground Color for Disable (IsEnabled=False) Records in xamdatagrid
posted

How to apply Foreground  Color for Disable (IsEnabled=False) Records in xamdatagrid

 

I am using following code is enabled working fine but  foreground color not applied for records

<igDP:XamDataGrid Name="XamDataGridSqlViews" GroupByAreaLocation="None" IsSynchronizedWithCurrentItem="True">

                           

<igDP:XamDataGrid.Resources>

                               

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

                                   

<Setter Property="BorderThickness" Value="1,0,1,1"/>

                                   

<Setter Property="BorderBrush" Value="LightGray"/>

                               

</Style>

                               

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

                                   

<Setter Property="Background" Value="White"/>

                                   

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

                                   

<Setter Property="BackgroundHover" Value="AliceBlue"/>

                                   

<Style.Triggers>

                                      

<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.IsMandatory}" Value="True">

                                           

<Setter Property="IsEnabled"  Value="False" />

                                       

</DataTrigger>

                                       

                                       

<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.IsMandatory}" Value="True">

                                           

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

                                       

</DataTrigger>

                                      

                                   

</Style.Triggers>

                                  

 

                               

</Style>

                

</igDP:XamDataGrid.Resources>

 

</igDP:XamDataGrid>