Whenever the user clicks a button I want to get the selected row in a DataGrid and change its background color?
I can get the index of the selected row using the SelectedIndex property but I do not know how to change the background of the same.
I use WPF, C# and .Net 4 in VS2010.
Thanks…
It’s better to use triggers for this sort of things but try the following
Edit
The selected
DataGridCellswill still override that background so you would probably have to handle that as well, using theTagproperty on the parentDataGridRowfor example