Background color and black selection


I have an issue with background colors for cells (in Sales order lines but I suppose it would happen somewhere else).

When I set a specific background color for a column, ie “PU Net” :


The column is correctly colored (PU Net in blue sky color here), except for the selected one, which (the entire line) is black.


As you can see, I set “ForegroundColor” and “LabelForegroundColor” in random colors for tests purposes, but it doesn’t affect the black one.

Any idea ? Thank you !

I think the problem lies in having different color schemes for some columns and the grid itself. Obviously grids use ActiveBackColor=Highlight background and ActiveForeColor=Highlight text by default, but these values are invalid in RGB color scheme and therefore the default RGB color (black) is used.

You could change grid’s ColorScheme to RGB, but you would get the same problem with columns that still use the default color scheme. You would really have to set everything to the same color scheme.

Another workaround may be to set grid’s HighlightActive property to No.

Probably the best option is not to use these properties at all. Rather implement displayOption() method on the form data source. For example:

public void displayOption(Common _record, FormRowDisplayOption _options)
    _options.foreColor(WinAPI::rgb2int(200, 200, 0);

    super(_record, _options);