Category / Section
How to change the background and foreground for the selected row or cell?
1 min read
In SfDataGrid, the Background and Foreground color of the selected row or cell can be changed by using RowSelectionBrush and SelectionForegroundBrush properties respectively.
XAML
<syncfusion:SfDataGrid x:Name="sfdatagrid" ItemsSource="{Binding Path=Products}" SelectionUnit="Cell" RowSelectionBrush="Red" SelectionForegroundBrush="Yellow">
Screenshot
Figure 1: To change the background and foreground for selected cell