Hi,
I'm using v9.1
So I'm trying to keep some conditional formatting intact in an ultragrid for a particular column when a row is selected (and subsequently highlighted). I'm using the BeforeSelectChange event to reset the individual cell selectedappearances to what I want them to be. I was easily able to translate the formatting code we have for everything EXCEPT the conditional formatting. Normally we set a property on the UltraGridColumn (ValueBasedAppearance taking a ConditionalValueAppearance that we create with a FormulaCondition). The problem is that there is no such ValueBasedAppearance property on the cell (which is what I have control over in BeforeSelectChange). I need to somehow tinker with the cell's selectedappearance and only that one cell's selectedappearance on row select. Any ideas how I can do this? I've to the length of even trying to evaluate the formulacondition myself and basing the formatting off of that result....but I haven't achieved that yet, and it even seems like an unnecessary step in the first place. Any ideas for how I can keep the conditional formatting intact for a selected row?
Thanks!
You are correct - there is no corresponding Selected property for ValueBasedAppearances.
So there are a couple of ways you can achieve what you want:
1) Don't use a ValueBasedAppearance. Instead, use the InitializeRow event to examine the cell's vaue and set it's Appearance and also it's SelectedAppearance.
2) Use a DrawFilter to change the appearance properties of the cell when it is selected.
I'd like to go with option #1, but it's a little unclear to me how/where the formula would be evaluated. I have is a FormulaCondition object (which I previously just handed to a ConditionValueAppearance along with the intended appearance). It sounds like from "examine the cell's value", you mean inspect the cell's value via GetCellText or something like that....when in fact what I really need to do is get just a boolean result from the FormulaCondition based off the cell's value. Is there something you had in mind to do this?