0

I have WPF Datagrid which has 4 x 4 matrix like that

  | A B C D
------------
1 | 6 8 9 0
2 | 3 5 8 3 
3 | 7 4 3 7  
4 | 2 1 5 8

We have 4 rows and 4 columns. Now I want to apply custom styles on datagrid cells. Currently I am able to apply styles on column level or on grid level. But I want it on cell level. If I want to make A1 cell with Style1, A2 with Style2, D3 with Style6 etc.

where ABCD are columns and 1|2|3|4| are row numbers.

How to remove and apply styles on datagrid cells at runtime?

Asad Naeem
  • 558
  • 8
  • 14
  • Do you have a condition for each style? For example, if its value is A then its background will be red, B is green, and etc. – Ekk Nov 02 '12 at 06:46
  • there are conditions but not on values, if (some condition is true) then A1,B1,B2,C1 cells will be red else if (some condition is true) then A2,B2,A3,C2 cells will be green and so on... – Asad Naeem Nov 05 '12 at 09:41

0 Answers0