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

Customise cell background

I'm trying to customise the cell background, and none of the SyncFusion examples work. The idea is to modify the Style, but I don't know which TargetType to use. The documentation refers to GridCell, but I get an InvalidOperationException saying that "'GridCell' TargetType does not match type of element 'GridCell'". Other documentation says to target VirtualizingCellsControl, but the compiler says that it doesn't have a Background property. So what should I use as the TargetType? Or is there another way to change the cell background?

I've attached a project which demonstrates this issue.

Attachment: GridCell_fc132cdd.zip

1 Reply

DM Dhanasekar Mohanraj Syncfusion Team March 14, 2023 02:39 PM UTC

Hi Russell,

We have checked the reported issue with the provided details. This issue occurs because of ambiguity in the GridCell and it can be resolved by adding a separate namespace for the DataGrid as shown below,


<grid:SfDataGrid ItemsSource="{Binding Items}">


        <grid:GridCheckBoxColumn MappingName="Selected" AllowEditing="True">


                <Style TargetType="grid:GridCell">

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




        <grid:GridTextColumn MappingName="Name">


                <Style TargetType="grid:GridCell">

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






Here, we have attached the modified sample with the above suggestion, please have a look at this.


Dhanasekar M.

If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.

Attachment: GridCell_427c299e.zip

Live Chat Icon For mobile
Up arrow icon