Hi Krzysztof,
The reported problem occurs due to defined the default style for GridCell. When
applying the theme to SfDataGrid, we merged the FluentLight merge resource
dictionary into the application. If you want to customize the cell style in
SfDataGrid you should use the relevant key for the target type, which is used
in MergedDictionary. If you didn't define the key, the default style merged,
which is why you saw the default border instead of the applied theme.
However, you can avoid this by adding the ResourceDictionary
based on the applied Theme (ex: FluentLight). BasedOn property bound with SyncfusionGridCellStyle
as StaticResource in defined Style based. Refer to the below code snippet.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--Here add the ResourceDictionary for the applied theme in
your application-->
<ResourceDictionary Source="/Syncfusion.Themes.FluentLight.WPF;component/SfDataGrid/SfDataGrid.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--Here add the BasedOn proeprty for override the theme
style for GridCell-->
<Style TargetType="syncfusion:GridCell" BasedOn="{StaticResource SyncfusionGridCellStyle}" x:Key="nullCellStyle" >
<Setter Property="Background" Value="LightYellow"/>
<Setter Property="Foreground" Value="Red"/>
</Style>
</ResourceDictionary>
</Application.Resources>
|
Find the modified sample in the attachment.
Regards,
Vijayarasan S
If this post is helpful, please consider Accepting it as the
solution so that other members can locate it more quickly.
Attachment:
ModifiedSample_f0221694.zip