We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TabItemHeader and DataGridRow style overridden?

So I'm trying to implement the metro Style into my application and struggle a bit with getting it working for some specific elements.
It works for the more easy ones such as buttons or Comboboxes but not for my DataGrids or TabControls (these are MS default controls).
It should be said that most of my controls are placed in separate UserControls.
<ResourceDictionarySource="/Syncfusion.Shared.WPF;component/SkinManager/MetroStyle.xaml"/>
Some code snippets:
I've referenced the XAML resource in my App.xaml
I know it's working in general as I can apply Basedon with "MetroButtonStyle".
<Stylex:Key="MetroButtonBase"TargetType="{x:TypeButton}"BasedOn="{StaticResourceMetroButtonStyle}">
<SetterProperty="Margin"Value="5"/>
Style>
But it isn't working for "TabItem" (black foreground color).
Note: This doesn't happen when I'm removing the reference for the Metro XAML from my App.xaml?
<Stylex:Key="MetroTabItemDefault"TargetType="{x:TypeTabItem}"BasedOn="{StaticResourceMetroTabItemStyle}">
...
Style>
Other than that, I'm experiencing the same behavior with my DataGrids even if there Style isn't overridden (MS style shown).
<DataGridx:Name="gridProjectList"
          Grid.Row="6"
          Grid.RowSpan="4"
          MaxColumnWidth="200"
          Margin="5"IsReadOnly="True"
          ColumnWidth="Auto"
          GridLinesVisibility="All"
          BorderBrush="{BindingElementName=gridProjectList,Path=HorizontalGridLinesBrush}"
          BorderThickness="1"/>
Also I'm having a DataGrid where I'm binding the background color of the rows to a value in a different column.
I need to change the Style for this. I'm also looking for a basedon variant here as the DataGrid is showing up with the default MS style.
<DataGridx:Name="prjExcludedItems"Grid.ColumnSpan="4"Grid.RowSpan="2"MinHeight="100"Margin="5"
          MaxColumnWidth="250"ColumnWidth="*"IsReadOnly="True"RowHeight="20"GridLinesVisibility="All"
          BorderBrush="{BindingElementName=prjExcludedItems,Path=HorizontalGridLinesBrush}"BorderThickness="1">
<DataGrid.RowStyle>

<StyleTargetType="DataGridRow">
<Style.Triggers>
<DataTriggerBinding="{BindingPath=PrjExclItemState}"Value="new">
<SetterProperty="Background"Value="LightGreen"/>
DataTrigger>
<DataTriggerBinding="{BindingPath=PrjExclItemState}"Value="remove">
<SetterProperty="Background"Value="#FFF38484"/>
DataTrigger>
Style.Triggers>
Style>
DataGrid.RowStyle>
 
<DataGrid.Columns>

<DataGridTemplateColumnWidth="SizeToCells">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ImageSource="{BindingPath=PrjExclImgPath}">
Image>
DataTemplate>
DataGridTemplateColumn.CellTemplate>
DataGridTemplateColumn>
 
<DataGridTextColumnHeader="GUID"Width="1*">DataGridTextColumn>
<DataGridTextColumnHeader="Value"Width="3*">
<DataGridTextColumn.ElementStyle>
<StyleTargetType="TextBlock">
<SetterProperty="HorizontalAlignment"Value="Right"/>
Style>
DataGridTextColumn.ElementStyle>
DataGridTextColumn>
<DataGridTextColumnHeader="Path"Width="5*"/>
<DataGridTextColumnHeader="State"Width="*">DataGridTextColumn>
DataGrid.Columns>
DataGrid>
Someone has a clue how to achieve this?

1 Reply

VI Vinothini Syncfusion Team November 22, 2016 10:49 AM UTC

Hi Marcus, 

We have checked your query related to MS TabControl and DataGrid. For MS TabControl, we have prepared a sample by overriding the style in the same window where TabControl is used. It doesn't work even when we override in App.xaml as the template doesn’t get created for TabItem when style get initialized.
 
 
Please find the sample which we have created 

For MS DataGrid currently we don't have theme support and it will be available in any of our upcoming release​​​
 

Regards
, 
Vinothini.R 
 


Loader.
Live Chat Icon For mobile
Up arrow icon