Background color and black selection

Hello,

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” :

2251.ProbColorsSaleLine2.jpg

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

7041.ProbColorsSaleLine.jpg

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.backColor(0xAAAA00);
    _options.foreColor(WinAPI::rgb2int(200, 200, 0);
    _options.affectedElementsByControl(Grid_Name.id());

    super(_record, _options);
}