edDateTimeEdit date bug

When changing the Day field in the edDateTimeEdit you must enter "09" instead of "9".  If you don't as soon as you click to a different column it reverts back to the previous value.

Steps
1. Click in a DateTimeEdit column.
2. Click in the Day section  of the component.
3. Change the day to "9".
4. Click on a different column or outside of the grid control.
5. The date has reverted back to the previous value.

Can't be reproduced here with 5.8.4.0 and default grid on the form initialized with:


procedure TForm4.FormCreate(Sender: TObject);
begin
  advstringgrid1.Options :=  advstringgrid1.Options + [goEditing];
  advstringgrid1.DefaultEditor := edDateTimeEdit;
end;

OK, I figured out the difference.
Use your Demo/asg4
change ShortDateFormat := 'dd/mm/yy';
to ShortDateFormat :='mm/dd/yyyy';

now repeat the steps given in the first post and you will see the same bug.

As a side note, if I set the ShortDateFormat to 'yyyy/mm/dd' the date editor pulls up as 'mm/dd/yyyy' format still, but the string shows correctly.

Your inplace datetimepicker is most likely still using the default format : d/M/yyyy. This means that you're editing the day which is after editing ends formatted to mm/dd/yyyy

So, set your inplace datetimepicker format to the same format as the global format:
AdvStringGrid.DateAndTimePicker.Format := 'MM/dd/yyyy';

I tried that, but whenever I do I get an error when it hits that line. (Control '' has no parent window')
Am I putting it in the wrong location?
I put "editGrid.DateAndTimePicker.Format := 'MM/dd/yyyy';" in TDemo.FormCreate after "EditGrid.Combobox.Sorted := True;"







I have seen this issue with the current release. It was fixed now. With next update, you'll be able to set this format.

When is this next update going to be coming out?  Our customer needs this feature soon.
Could you send us the code changes and we would implement it and do more testing for you?

I have retested this here with the latest version v5.8.7.0 with a default grid on the form and the code:


procedure TForm4.FormCreate(Sender: TObject);
begin
  advstringgrid1.DateAndTimePicker.Format := 'mm/dd/yyyy';
  advstringgrid1.Combobox.Sorted := false;
  showmessage(advstringgrid1.GetVersionString);
end;

and this works without any issue.
Ok, I found one of the problems.  AdvGrid function TAdvStringGrid.EditDate Ln ~31853
Is missing the FEditDate.Parent  := Self;
(This fixes my noparent window error.  I will just fix it in my code util your next release.)
 
However, setting editGrid.DateAndTimePicker.Format := 'MM/dd/yyyy'; still did not fix the problem in the beginning of this thread.  You still must use 2 digits in the date.  Even when you set the format to 'M/d/yyyy'. 
 
Click the day field and hit a single number and then click out of that field into a new cell.  The date changes back to what it was originally.
 
Thanks.
 
 

I have retested this with a default grid on the form with the code:


procedure TForm4.FormCreate(Sender: TObject);
begin
  advstringgrid1.DefaultEditor := edDateEdit;
  advstringgrid1.Options :=   advstringgrid1.Options + [goEditing];
  advstringgrid1.DateAndTimePicker.Format := 'MM/dd/yyyy';
  advstringgrid1.Combobox.Sorted := false;
end;

and this works without any issue.

Again, is this the latest version you're using? v5.8.7.0?

Ok, I just tried using a new grid next to my old one, and it works fine. 

However, the old grid does not work.  Also the old grid in example asg4 also still has the same problem.
 
Do I have to delete the old grid and replace it with a new one to get this to work, or is there something I can change in the .dfm?

Yea, I got it. 

It MouseActions->DirectEdit needs to be False.  If it is True then you have to enter both 2 digits before clicking out. 
 
The problem is we need DirectEdit to be True. 
 
Thanks,