TAdvStringGrid assigned colors change in IDE

We are converting an existing application towards Delphi 11.2 and TMS VCL UI Pack

When we open forms with TAdvStringGrid components in the RAD Studio IDE, we notice that some color properties are automatically changed.
But when we revert the changes, build the application and run, the colors are as expected.

Is this an expected behaviour?

We used the following steps to test this behaviour:

  1. Create a new Windows VCL Application
  2. Open the form
  3. Add a TAdvStringGrid in the form
  4. Change the TAdvStringGrid color property to anything but clWindow
  5. Save the form and close it
  6. Open the form again
  7. Notice that the color has been set back towards clWindow

Are you using a VCL style or a TAdvFormStyler or the UIStyle property different from tsCustom?

When using a VCL style, set grid.StyleElements = []
When using a TAdvFormStyler, exclude the grid from being styled.
Set grid.UIStyle = tsCustom

Thank you for the quick reply!

Sadly, none of those suggestions apply to our situation.
We are not using a VCL Style, no TAdvFormStyler and on all the grids the UIStyle is set to tsCustom.

We noticed, while debugging the component, that after TAdvStringGrid.Loaded was called, TAdvStringGrid.VCLInitStyle is called with argument True from TAdvStringGrid.CmStyleChanged

We believe that this is causing the problem, because with the parameter init being True, the inline-procedure InitColors is called in designtime. Which changes the color properties, after they are loaded from the DFM.

I cannot reproduce this, so please isolate this and provide a sample source project with which we can reproduce the problem here so we can investigate.

Hi Bruno,

Sorry for the belated response with an example project.
It seems that the colors are changed, but no change is detected by RAD Studio.

We noticed that the colors were changed, when we opened one of the forms, changed something and saved the changes. After we opened our git tool, the git difference shows a change of properties we did not change by ourself.

In this example focus on the GridColorLine property. It should be clRed in the belowest grid of TForm1 and in the grid of TForm2, but when you open the forms in RAD Studio it is changed in clSilver.

If you still cannot reproduce, we could make some screenshots showing this.

ExampleChangingColors.zip (168.5 KB)

Do you use the latest version of the components, as I retested this here with your project and both at design-time & run-time I see the red grid line color in the bottom grid:

Sadly enough, after using installing version of TMS VCL UI Pack it still does change the values.
We made a video showing, what is happening at our development machine.

I uploaded the video to my onedrive:

We could now understand this Delphi 11 specific issue.
We've addressed this now. When you set in the next update seClient = false in AdvStringGrid.StyleElements , this will behave as you expect.

We just installed the newest version and applied the suggestions.
It worked with seClient on false, the colors are not changing anymore.
Thank you for the effort!

Just wondering, should be applied this to all our existing grids or will there be another solution for existing grids coming in new versions?

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

This is the solution by design.