TreeGrid Cells Tutorial
7. Conditional formatting and styling
TreeGrid can calculate cell's look according to its value or any other condition
07 -

Conditional Formatting

.xml
Remember, when you specify Formula for cell attribute like Class, Color or Icon, you must add it to the row CalcOrder list, otherwise it will be ignored. To add CalcOrder to all rows, set it to the <D Name='R'/>. Remember, when you set CalcOrder attribute, you must list here also all calculated cells.
For example <Def><D Name='R' CalcOrder='Col1Class,Col3,Col3Color,Col5'/></Def> when set <C Name='Col1' ClassFormula='...'/><C Name='Col3' Formula='...' ColorFormula='...'/><C Name='Col5' Formula='...'/>.
All the ...Formula attributes can be set also to individual cells, not only to whole columns. In this case the row must have set Calculated='1'.
The conditional formatting can be used also for any other cell Type like Date, Enum or Text, not only numbers.
The Format, Color and Class attributes can be calculated also in API events OnGetFormat, OnGetColor and OnGetClass.