AdvStringGrid CombBox formatting

Hi,

I'm using DefaultEditor := edComboList and I would like format it as follows please:

  • Color = clWhite
  • Text Align = centre

I've tried setting AdvStringGrid1.ComboBox.Color := clWhite but the combobox remains grey.

I cannot see a text align setting. The Alignments[C, R] property is already taCenter but the drop down does not respect this.

I have set AdvStringGrid1.ComboBox.Style = csOwnerDrawFixed and implemented AdvStringGrid1.ComboBox.OnDrawItem but this has no effect either.

Many thanks
Stuart

Is most likely due to operating system and/or VCL Styles combobox appearance.
Does the standard VCL TComboBox behave different in this same app? I.e. is color working there?
Also, text alignment applies to cell rendering but the default VCL TComboBox that is used as inplace editor doesn't support alignment control. You'd need to use a custom combobox control if you want this.

Hi Bruno,

That makes sense about the appearance.

With a VCL TComboBox I can set style to csOwnerDrawFixed and implement OnDrawItem -- but I don't seem to be able to do that with the AdvStringGrid.ComboBox even though the properties and events are available.

If you need this, I suggest to use a custom control as inplace editor.
As shown in:
https://www.tmssoftware.com/site/asg55.asp

1 Like