Setting DataGrid RowStyle based on a property in my bound ItemsSource

Nov 12, 2009 at 4: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 14, 2009 at 12:50 AM

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