AdvStringGrid ColorPickerDropDown

I am trying to implement a default color button with the AdvStringGrid ColorPickerDropDown
any help appreciated


procedure TForm1.StringGrid1GetEditorType(Sender: TObject; ACol,
  ARow: Integer; var AEditor: TEditorType);
begin
  case ACol of
  1,2: AEditor := edColorPickerDropDown;
  end;

  if (ACol = 1) or  (ACol = 2) then
  begin
    StringGrid1.ControlLook.DropDownFooter.Buttons.Clear;
    StringGrid1.ControlLook.DropDownFooter.Buttons.Add.Caption :='List';
    StringGrid1.ControlLook.DropDownFooter.Buttons.Add.Caption := 'Cube';
    StringGrid1.ControlLook.DropDownFooter.Buttons.Add.Caption := 'Spectrum';

    StringGrid1.ControlLook.DropDownHeader.Buttons.Clear;
    StringGrid1.ControlLook.DropDownHeader.Buttons.Add.Caption :='Default';
  end;
end;


procedure TForm1.StringGrid1DropDownHeaderButtonClick(
  Sender: TObject; ACol, ARow, ButtonIndex: Integer);
var
  Colour : TColor;
begin
  Colour := GetDefaultColor(ARow,ACol);

  case ButtonIndex of                            
    0: StringGrid1.ColorPickerDropDown.SelectedColor := Colour;
    //This works with AdvOfficeColorSelector but not ColorPickerDropDown
  end;
  //Need to close ColorPickerDropDown ?

end;

You can call


stringgrid1.ColorPickerDropDown.HideDropDown(false);

to close the color picker dropdown
 
Thanks, that works.
I also added a call to StringGrid1ColorSelect which is needed if the color is not in the list.
 
StringGrid1.ColorPickerDropDown.SelectedColor := Colour;
StringGrid1.ColorPickerDropDown.HideDropDown(false);
StringGrid1ColorSelect(nil, ACol, ARow, Colour, '');