Implicit styles not working

Nov 10, 2008 at 9:35 AM
I have a DataGrid with a number of DataGridTextColumn definitions. I have the following styles defined:

<Style TargetType="{x:Type TextBox}">
    <Setter Property="Foreground" Value="Green"/>
</Style>

<Style TargetType="{x:Type TextBlock}">
    <Setter Property="Foreground" Value="Orange"/>
</Style>

I am wondering why the cells of my DataGrid do not reflect these styles? I know that I can style the DataGrid Cell to achieve this effect, however i am just wondering why implicit styles do not work on the visual elements that the DataGrid has constructed?

Thanks,
Colin E.





Coordinator
Nov 10, 2008 at 1:32 PM
Apply these styles to each DataGridColumn.ElementStyle and DataGridColumn.EditingElementStyle.