I've read this post How can I set the color of a selected row in DataGrid and they have a lot of good answers but none of this answers worked for me ot maybe i did not implement the code on the correct place.
i haven't changed anything like making a cell style of my own but i'n using the next packages: MahApps.Metro,MvvM.light.libs,EF,Extended wpf toolkit (XCEED) this last one i added to try something to solve the problem but still didn't work.
Could this packages cause me problems ?? i have tried all of the solutions of the post i mentioned.
Could this packages cause me problems ??
Yes, MahApps.Metro overrides the default DataGrid
styles and uses different resource keys than the system style.
You simply need to adapt the answer from the linked question to accommodate the MahApps resource keys:
<DataGrid.Resources>
<SolidColorBrush x:Key="MetroDataGrid.HighlightBrush"
Color="Crimson" /> <!-- Set your own color here -->
</DataGrid.Resources>
There are some related background brushes you might want to override too:
MetroDataGrid.InactiveSelectionHighlightBrush
MetroDataGrid.MouseOverHighlightBrush
MetroDataGrid.DisabledHighlightBrush
And some foreground brushes:
MetroDataGrid.HighlightTextBrush
MetroDataGrid.InactiveSelectionHighlightTextBrush
You can inspect the MahApps styles on GitHub to see what brush resources they use, and when.