Category / Section
How to apply the row mouse hover effect in WPF DataGrid (SfDataGrid)?
1 min read
WPF DataGrid (SfDataGrid) provide the support for change the background color while hovering the mouse. You can achieve this by enabling the AllowRowHoverHighlighting property and set the color by using RowHoverHighlightingBrush property in WPF DataGrid (SfDataGrid).
<syncfusion:SfDataGrid x:Name="sfDataGrid" AllowRowHoverHighlighting="True" RowHoverHighlightingBrush="Yellow" AllowResizingColumns="True" ColumnSizer="Star" ItemsSource="{Binding Orders}" AutoGenerateColumns="False"> <syncfusion:SfDataGrid.Columns> <syncfusion:GridTextColumn HeaderText="Order ID" MappingName="OrderID"/> <syncfusion:GridTextColumn HeaderText="Customer ID" MappingName="CustomerID" /> <syncfusion:GridTextColumn HeaderText="Customer Name" MappingName="CustomerName" /> <syncfusion:GridTextColumn HeaderText="Country" MappingName="Country" /> <syncfusion:GridTextColumn HeaderText="Unit Price" MappingName="UnitPrice" TextAlignment="Right"/> </syncfusion:SfDataGrid.Columns> </syncfusion:SfDataGrid>