views:

334

answers:

1

Okay, still on my silverlight app here, what I need to do is to somehow perform conditional formatting on 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.

So how would i go about performing conditional formatting of one value based upon multiple values?

A: 

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.

Mark Cooper
Yes, this is essentially what I wound up doing, ... your second point. In my SQL query I created a new field which brought back the conditional values as needed, and used that for formatting.
eidylon