Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
Themes vs Styles in XamDataGrid
posted

Hi,

I am facing issues in applying theme as well as styles on XamDataGrid. I am setting the theme

followed by some style to the XamDataGrid as follows.

<xam:XamDataGrid  Name="grd" >
                <xam:XamDataGrid.Resources>
                    <Style TargetType ="{x:Type xam:XamDataGrid}">
                        <Setter Property ="Theme" Value ="RoyaleStrong" ></Setter>
                    </Style>
                    <Style TargetType="{x:Type xam:DataRecordPresenter}" >
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Record.DataItem.Age, RelativeSource={RelativeSource Self}}" Value="22">
                                <Setter Property="Background" Value="Green" />
                                <Setter Property="Style" Value="{StaticResource XamDataGridStyle}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </xam:XamDataGrid.Resources>
               
            </xam:XamDataGrid> 

The issue here is, the theme is getting applied, after that, the stye trigger for DataRecordPresenter also getting applied, but

the grid header's background is changed to normal gray colour. If you remove the style trigger, the grid

header's background is fine. I want the style trigger to be applied retaining the theme.

 Could you please suggest a way around how to correct this issue?

 

Thanks in advance.

Ganesh