views:

48

answers:

1

How to select a row(e.g.frist row in datagrid) and set its background color to be e.g. red in C#?

I have following code in my program:

 gameDataGrid.RowBackground = new SolidColorBrush(Colors.Red);

The output is shown below, the background is not red....

alt text

A: 

If you are wanting to change multiple rows based on some property, wire up the LoadingRow event and change the DataGridRow's style in the event handler.

Stephan