TAdvStringGrid and Date Edit

Using edDateEdit in a grid to edit dates. I set the format to yyy-MM-dd, but on selecting a date the format in the cell changes to dd/MM/yyy. This does not happen with the Delphi DateTimePicker.

if ARow = FColDueDate then
      AEditor := edDateEdit;
      grdDetails.DateTimePicker.Format := 'yyy-MM-dd';
      if FUpdatedIssue.DueDate.trim <> '' then
           grdDetails.DateTimePicker.Date := lDate;

I tried formatting in the onDateTimeChange event but that did not do anything.,

procedure TframeEditIssue.grdDetailsDateTimeChange(Sender: TObject; ACol, ARow:
    Integer; ADateTime: TDateTime);
  grdDetails.Cells[ACol,ARow] := FormatDateTime('yyy-MM-dd',ADateTime);


Am I doing something wrong?


By design, TAdvStringGrid uses the Delphi date/time format settings (picked up from the operating system) to format the date to display in a cell. To change this, you'd need to change the Delphi date formatting specifier : FormatSettings.ShortDateFormat