OnGetCellProp is the event to use to customize the cell background color by modifying the ABrush.Color parameter. There is no need to perform custom drawing for this.
Looking at the Object inspector for ADVStringGrid I don't see an OnGetCellProp, I can see OnGetCellColor, OnGetBorderColor and GetCelBorderProp but no OnGetCellProp. This is with v8.8.3.0.
Sorry, I confused with another component. I meant to use OnGetCellColor
Is there no way to set the ColorPIckerDropDown selected colour byTColor rather than itemindex? All I want to do is to set the ColorPickerDropDown to the colour of the Brush.Color of the cell it is editing.
I do not understand why you have an issue with this. The ColorPickerDropDown automatically picks up its color from the cell color, so there should be no code to add.
If you want to override the color with which the editor starts editing, set grid.Colors[acol,arow] := YourColor from the OnGetEditorProp event handler.
I have stripped out the code for setting the ColorPicker Index.
The behavior you describe is by design.
When you want that the cell editor opens on the first click, set grid.MouseActions.DirectEdit = true
I have done that now, it drop s down immediately but it is still defaulting to clWhite when the cell is in cat clNavy.
Do you set the cell default color with grid.Colors[col,row]:TColor
No, should I?
I'm not sure how else you expect it to pick up clNavy as the default cell color is clWhite.
I have already loaded the cell colours into the grid from the registry on the getCellColor event, I just want it to pick up the colour which is already there. Do I have to set grid.colors[row,Col] as well?
Just grid.colors[Col,Row] should be sufficient.
Thanks for all your help... I now have it doing what I want. I have removed setting the Brush colour in GetCellColor and now only set the font colour so that it contrasts with the back colour. Setting the colors[Col,Row] works perfectly.