Implicit styles not working

Nov 10, 2008 at 8: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 TargetType="{x:Type TextBlock}">
    <Setter Property="Foreground" Value="Orange"/>

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?

Colin E.

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