Hi
I've got a Grid which has a single column in a row of two columns. This column is using the DropDown control as a lookup via the ValueList property on the Column. It works great.
However, two questions:
1. Using conditional formatting, is it possible to apply a format derived from one column across a whole row (or to another column) e.g. If ColumnA = 1 then set ColumnB's ForeColor to Red?
2. I can't get Conditional Formatting working using the DropDown column. It seems that the formats themselves come from the "real" column settings - but the logic to determine a match (with Operators) works against the lookup value e.g. I have a column called StatusId, where this can be 0, 1, or 2. The DropDown resolves this to "Live", "Cancelled", or "Complete". I want to color-code the rows depending on this status value. Where do I put the conditional format - on the WinGrid column (in which case what should I set the operators to match against?) or against the DropDown control? I have tried both approaches but neither seems to "work". Any advice greatly appreciated.
Thanks
Isaac
Issac,
If I read your first question correctly, you want to resolve a cell's appearance based on the value in a different column. This is possible using a FormulaCondition, which is only available if you site an UltraCalcManager on the form. An example of a formula that you could use is "[Column 1] = 1"
As for your second issue, the values that a condition will compare against 'owner' values; that is to say, whatever is actually stored in a cell is what's used for comparison. When you have text showing that maps to a number, that does not necessarily have anything to do with the value, since it could have been altered with a DataFilter, editor, etc. You could submit a feature request to expose the option on whether the grid should provide a condition/ValueBasedAppearance with the display text instead of the value, but for now you will have to use the underlying value.
-Matt
Matt,
Another question. I am now using the FormulaCondition with the UltraCalcManager. If I had ten columns and wanted them all to show as Red based on the value of an eleventh column, do I have to make separate Formulas for each column, each with identical conditions e.g. If [Column 11] = 0 then [Set forecolour = Red]?
Thanks again
Matt Snyder"]As for your second issue, the values that a condition will compare against 'owner' values; that is to say, whatever is actually stored in a cell is what's used for comparison. When you have text showing that maps to a number, that does not necessarily have anything to do with the value, since it could have been altered with a DataFilter, editor, etc. You could submit a feature request to expose the option on whether the grid should provide a condition/ValueBasedAppearance with the display text instead of the value, but for now you will have to use the underlying value.-Matt
Thanks for your reply. I've actually stopped using the UltraDropDown and am now using ValueLists by adding them to the column and at runtime populating them from a datasource - they perform much, much faster than an UltraDropDown. Using the underlying value is fine, I just want to know what I should be doing! :-) Can you tell me if I am correct here:
Column = Rating . Possible values = 0, 1, and 2 (from my datasource).
I then add a ValueList in the designer called Rating. In code at runtime I then populate the possible values:
0 = Passed,1 = Pending, 2 = Failed.
When I run the application, the grid correctly resolves the lookup, but the ValueBasedAppearances don't take effect. Nothing happens. If I stop using the ValueList, the ValueBasedAppearances start working - but of course I then don't get the text, just the numbers.
What am I doing wrong?