I have a wpf 4.5 application that has a datagrid in a usercontrol. I designed the style for the datagrid in Blend but when I copy the style into my VS 2012 project it is not working properly.
Here is what the base style looks like in Blend:
Please note the color of the text in the selected row (green) and the padding around the textbox that is being edited
Now here is what the same style looks like Visual Studio 2012:
So the highlighted text from the selected row is the same color as the background (making it invisible), and I can't change the textbox bordercolor or margin to match the blend style.
here is the cell style:
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border x:Name="border"
BorderBrush="Transparent"
BorderThickness="1"
Background="Transparent"
SnapsToDevicePixels="True"
Margin="15,10,15,10">
<ContentPresenter Name="CellContent" SnapsToDevicePixels="True" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Green"/>
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" TargetName="border" Value="#FFD8D8D8"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
so you can see that the trigger marking green as the foregorund color works in blend but not visual studio. I think it is a system color that is overriding the trigger some how but I am not sure how to track this down.
Can someone please help me correct this style problem by setting the selected row text color and textbox border/margins.
This is a link to the entire datagrid style resource dictionary
thanks in advance