Question

I am working in WinForms with Infragistic's UltraGrid control. I want to make it so that my activated row shows cell's which have errors using a different background color than the rest of the row.

Currently, if the row is not activated, I see the errored cells with a red background, and the validated cells having a white background. However, when I select the row and it is activated, I cannot see which cells have errors any longer as the whole row has it's background set to yellow.

What I want to see is, that if the row is activated, all valid cells are yellow, and all invalid cells are red. If there are no invalid cells, then all cells are yellow.

Currently, I am de-activating the row if it is found to have an error. This works as long as the user doesn't click on the row again, which is a pretty lame assumption. I've looked into DisplayLayout.Override, which allows me to override at grid, band, row, column, and cell level, but when I override at the cell level it seems that the settings at the row level are still taking precedence.

Was it helpful?

Solution

Infragistics support suggested taking advantage of the ActiveAppearance and ActiveAppearanceEnabled properties on the cell itself, however, I'm stuck with an earlier version of Infragistics in which those properties were not implemented.

In the end I had to implement a custom draw filter for the cell using the IUIElementDrawFilter class. Examples of implementing IUIElementDrawFilter can be found at http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.1/CLR2.0/html/Infragistics2.Win.v12.1~Infragistics.Win.IUIElementDrawFilter.html.

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