How to set background of a datagrid cell during AutoGeneratingColumn event depending on its value?

I can propose two different solutions for your question: the first is “code-behind-style” (which you are asking for but personally I think it is not right approach in WPF) and more WPF-style (which more tricky but keeps code-behind clean and utilizes styles, triggers and converters) Solution 1. Event handling and code-behind logic for coloring First … Read more