Question

I have found quite a few examples about conditional formatting of rows and cells in a DxGrid but none of them fit my purpose.

I want to format background color and font-boldness of a cell, based on other properties of the row's viewmodel. Suppose my viewmodel contains an integer "Age", a boolean "Retired" and a date "Retirement Date". The cell that contains the Age must have a bold font when the retired boolean is true. The background color of the cell must gradually become more blue when the Retirement Date is farther away in the past.

I experimented with value converters but I cannot get access to the properties of the view model from within the ValueConverter. Is there a way to achieve this? I thought of using MultiValueConverters but I do not seem to get it working.

Any hintsthat get me on my way would be appreciated. Preferably as declarative (in XAML) as possible.

Thanks in advance. ~Rob

Was it helpful?

Solution

I believe you can use approach described in the How to: Conditionally Apply Styles example.

Related help article: Styles and Templates Overview

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top