I use the sfDataGrid to show data. There's a checkbox control in per row. It works well.
Now, I want to change checkbox's background, I specify my custom style for it, but it didn't work.
You can see my xaml code:
<Page.Resources>
<Style x:Key="CheckBoxStyle1" TargetType="CheckBox">
<Setter Property="Background" Value="Red"/>
</Style>
<DataTemplate x:Key="cellTemplate">
<CheckBox Content="abc" IsChecked="{Binding IsChecked}" Style="{StaticResource CheckBoxStyle1}"></CheckBox>
</DataTemplate>
</Page.Resources>
<Page.DataContext>
<local:ViewModel />
</Page.DataContext>
<Grid>
<syncfusion:SfDataGrid x:Name="dataGrid"
AllowFiltering="True"
ItemsSource="{Binding Orders}">
<syncfusion:SfDataGrid.Columns>
<syncfusion:GridTextColumn HeaderText="Order ID" MappingName="OrderID" />
<syncfusion:GridTextColumn HeaderText="Customer ID" MappingName="CustomerID" />
<syncfusion:GridTemplateColumn MappingName="IsChecked" CellTemplate="{StaticResource cellTemplate}">
</syncfusion:GridTemplateColumn>
<syncfusion:GridTextColumn HeaderText="Customer Name"
MappingName="CustomerName" />
</syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>
</Grid>