In the article about the basic customizations of the DataGrid control we showed how to change the color of the rows and of the alternating rows, how to modify the headers' and the gridlines' visibility. But we haven't mentioned anything about how to change the look of the row when the mouse is over it or when it's selected. Let's take a look how we can achieve that.
Before starting
I won't start directly with the explanation of each thing and step we have to do. Instead I’ll start with a few common things. First there is no specific property for the color of the selected row, as RowBackground and AlternatingRowBackground and the only property that comes in hand is the RowStyle. The Target property of the style must be set to DataGridRow and the thing we have to customize is the Template property. I've tried to do this using the Expression Blend, but I didn’t find a way to get to this Template, so I had to disassemble the System.Windows.Controls.Data.dll and get the template from there. After that I modified what I needed in the VisualStudio.