Oliver
  • Oliver
  • Advanced Member Topic Starter
2014-01-17T11:32:58Z
I have a RowDynamicFormatting-EventHandler, which changes the oForeColor of the row to light grey, when the checkbox of the row is not checked (i.e. disabling the row). This works on most cells, but not all. The cells that keep their color are those that have been assigned a different color explicitly either in the column-default-object returned form .AddCol or later by using .CellForeColor.

Since the RowDynamicFormatting-event would be convenient to handle the enable/disable scenario, I would like this to work. It saves me the trouble to recreate all the coloring/fonts on enable, since i can keep the original format on the cells and just overwrite it on "DynamicFormatting".

Regards,
Oliver
Igor/10Tec
2014-01-20T10:57:00Z
Oliver, it's not a bug.

Row foreground color and cell foreground color are two different "layers", and the cell forecolor layer is on top of the row's one. Even if you redefine the whole row forecolor, this setting is "overlapped" by the cell forecolor setting.

If I understand your logic right, you need to use the CellDynamicFormatting event instead.
Oliver
  • Oliver
  • Advanced Member Topic Starter
2014-01-20T11:54:21Z
Thanks for clearing that up, Igor!

I used the RowDynamicFormatting for Performance-reasons as the evaluation for the rowcolor may depend on more than just the checkbox, maybe even containing a database-query. I changed my code and moved the easy formatting to the CellDynamicFormatting and the hard parts into the AfterCommitEdit event. Works ok now.

Thanks,
Oliver