In WPF DataGrid's template of DataGridCell we can change the Background of selected cell.
But how to change the first cell's background color when a row is selected? Just like what the following picture shows.
You have to write your own cell style to highlight each cell background
<Window.Resources>
<Style x:Key="CellStyle" TargetType="DataGridCell">
<Setter Property="Background" Value="Yellow" />
</Style>
</Window.Resources>
<DataGrid x:Name="dataGrid" CellStyle="{StaticResource CellStyle}">
</DataGrid>
Could you please go through the following link
http://techiethings.blogspot.ch/2010/05/get-wpf-datagrid-row-and-cell.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.