Setting DataGrid RowStyle based on a property in my bound ItemsSource

Nov 12, 2009 at 3:34 PM


I have an ObservableCollection of "Foo" objects which I am using as the ItemsSource for a DataGrid. Foo has a boolean property "CanAck" and I'd like to set the RowStyle based on this bool. I already have a style defining foreground and background colours which works fine but I'd like to invert these if the value of "CanAsk" is false. Can anyone point me int he right direction?



Nov 13, 2009 at 11:50 PM

RowStyleSelector would give you the functionality to change the full style depending upond the data in that row.