CellStyle background not working in Release

I have this DataGridTextColumn where I have added a CellStyle where I set the background to grey.

In debug it's showing up correctly, but when I run the app in Release mode the background is just white.

                    <syncFusion:DataGridTextColumn.CellStyle>

                        <Style TargetType="syncFusion:DataGridCell">

                            <Setter Property="Background" Value="{StaticResource LightGreyColor}" />

                        </Style>

                    </syncFusion:DataGridTextColumn.CellStyle>


Any ideas?


1 Reply

TP Tamilarasan Paranthaman Syncfusion Team February 23, 2024 12:02 PM UTC

Hi Veeningen,

Based on the provided code snippet, we have thoroughly tested a basic sample on our end, specifically in Release mode. However, we were unable to replicate the reported issue. The cell background color was correctly applied without encountering the problem you described.


To facilitate a more effective resolution, we kindly request you to review the attached sample on your end. If there are any configurations or adjustments that need to be made to reproduce the issue accurately, please modify the sample accordingly.


Providing a sample that accurately demonstrates the problem will allow us to conduct a more thorough investigation on our end and provide a solution promptly.


<?xml version="1.0" encoding="utf-8" ?>

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             xmlns:local="clr-namespace:MauiApp1"

             xmlns:dataGrid="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid"

             x:Class="MauiApp1.MainPage">

 

    <ContentPage.BindingContext>

        <local:OrderInfoRepository x:Name="viewModel"/>

    </ContentPage.BindingContext>

    <dataGrid:SfDataGrid x:Name="dataGrid"

                         AutoGenerateColumnsMode="None"

                         ItemsSource="{Binding OrderInfoCollection}">

        <dataGrid:SfDataGrid.Columns>

            <dataGrid:DataGridTextColumn MappingName="OrderID" HeaderText="Order ID">

                <dataGrid:DataGridTextColumn.CellStyle>

                    <Style TargetType="dataGrid:DataGridCell">

                        <Setter Property="Background" Value="Cyan" />

                    </Style>

                </dataGrid:DataGridTextColumn.CellStyle>

            </dataGrid:DataGridTextColumn>

            <dataGrid:DataGridTextColumn MappingName="CustomerID" HeaderText="Customer ID"/>

            <dataGrid:DataGridTextColumn MappingName="ShipCity" HeaderText="Ship City"/>

            <dataGrid:DataGridTextColumn MappingName="ShipCountry" HeaderText="Ship Country"/>

            <dataGrid:DataGridNumericColumn MappingName="Price" HeaderText="Price"/>

 

        </dataGrid:SfDataGrid.Columns>

    </dataGrid:SfDataGrid>

</ContentPage>

 


Note: We have conducted tests using the latest DataGrid version 24.2.7 and .NET 8 on the Windows platform (Release mode).


Regards,

Tamilarasan


Attachment: Sample_6f9ec39e.zip

Loader.
Up arrow icon