Hi All,
I have design a C# datagrid using wPF. I can now add my data into the datagrid well. Below is my xaml settings for my datagrid. My only challenge is that if any of the column values is with **Error I want the text to be red and bold. How to achieve this?
<TabItem Header=" Records"> <DataGrid x:Name="gridRE" RenderOptions.ClearTypeHint="Enabled" TextOptions.TextFormattingMode="Display" Margin="18,17,0,0" SelectionUnit="FullRow" AutoGenerateColumns="False" HorizontalAlignment="Left" VerticalAlignment="Top" Height="350" Width="972" > <DataGrid.Columns> <DataGridTextColumn Header="RecordID" Binding="{Binding RowID}" /> <DataGridTextColumn Header="CName" Binding="{Binding CName}" /> <DataGridTextColumn Header="BRN" Binding="{Binding CBRN}" /> <DataGridTextColumn Header="FCD" Binding="{Binding FileCreationDate}" /> </DataGrid.Columns> <DataGrid.CellStyle> <Style TargetType="{x:Type DataGridCell}"> <Setter Property="Foreground" Value="{Binding Report}" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Background" Value="Pink"/> <Setter Property="Foreground" Value="White"/> </Trigger> </Style.Triggers> </Style> </DataGrid.CellStyle> </DataGrid> </TabItem>