I'm new to WPF, and have the following problem:
I have a ListView presented as grid. The columns of the grid are added dynamically from code behind (myDataGrid is the GridView inside myListView):
myListView.ItemsSource = myDataTable.DefaultView;
foreach (var col in myDataTable.Columns) {
var column = new GridViewColumn();
column.Header = col.ColumnName;
column.DisplayMemberBinding = new Binding(col.ColumnName);
myDataGrid.Columns.Add(column);
}
This works fine, i'm only having touble styling it. So how can I add a custom styling to these columns based on their values? For example, I would like that every cell that has the "0" in it to have yellow background.