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
    begin
      AEditor := edDateEdit;
      grdDetails.DateTimePicker.Format := 'yyy-MM-dd';
      if FUpdatedIssue.DueDate.trim <> '' then
         begin
           ConvertDate(FUpdatedIssue.DueDate,lDate);
           grdDetails.DateTimePicker.Date := lDate;
         end;
    end

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

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

end;

Am I doing something wrong?

Dave

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