Question

I need to conditionally format the cells of a datagrid, but the "conditional" part needs to be based upon the values of several different fields/properties in the datasource.

I thought I could use the typical IValueConverter method of conditional formatting and pass the "other" values into the converter through the ConverterParameter, but it seems you can't bind ConverterParameter to anything and can only pass in literals.

How would I go about performing conditional formatting of one value based upon multiple values?

Was it helpful?

Solution

Can you paste some code for what you are trying to acheive?

You can do this with binding and having properties in your business class that reflect the conditional state - i use this regularly to show/hide or enable/disable controls on my views.

Alternatively to specifically format a datagrid cell you could overload the dataGridCell object and provide some additional visual states that reflect your conditions. - or - you can setup a load of CellStyles and apply those dynamically.

Hope this gets you started.

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