Anyone know how to get multiple conditional formatting to work in a grid cell?
Example: In our product, a zip code can be 5 digits, 9 digits with a dash, and alphanumeric (Canadian). A Mask will not work for this situation, and it seems I can only set a format on a column, and cannot conditionally format a cell differently. We do not want to store the dash in the 9 digit case, so it needs to be a format only, not a modified underlying value.
What you need to do is use an editor - or rather three editors. What you would do is create 3 UltraMaskedEditor controls on your form with the grid. You would set up one to have a 5-digit zip code mask, another to have 9 digits, and the last to handle Canadian. Then you use the InitializeRow event of the grid to set the EditorControl property of the Cell to the appropriate MaskedEditor control that has the mask you want.
In itself, the above won't work, because the grid mask settings take precedence over the editor. So you also need to use UseEditorMaskSettings on the column to true.
This sounds like a good approach. I will try it.
It turns out that this approach was not successful. Wasn't able to figure out how to get an ultramaskededit dynamically and associate it with the the editor at runtime (it is not practical for us to manually drop these on the form at designtime).
What I did do that works great is use a datafilter.