Hello
I am using TcxDateEdit format datetime.
When I set the date and time through the drop-down calendar (for example now), OnEditValueChanged is triggered. It is right
But when I switch to another control, OnEditValueChanged is triggered again, although the value has not changed. This is bad because leads to repeated execution of the request.
If you work with the date-only format, then the OnEditValueChanged event does not fire when focus is lost.
cxDateEdit - The OnEditValueChanged event can occur twice when an end-user changes the edit value via the editor's drop-down window if the Properties.Kind property is set to ckDateTime
Answers approved by DevExpress Support
We have addressed the issue described in this ticket and will include a fix in our next maintenance update. To apply this solution before official release, request a hotfix by clicking the appropriate version link.
Note: Hotfixes may be unavailable for betas/updates set for release within a week.
Hello Ilya,
I couldn't replicate the behavior you described with your EXE file. I followed these steps:
"
… Component deDateTime fired event OnEditValueChanged
… Component deDateTime fired event OnExit
"
"
… Component deDateTime fired event OnEditValueChanged
… Component deDateTime fired event OnExit
… Component deDate fired event OnEditValueChanged
"
As you can see, the OnEditValueChanged event is not raised twice for the DateEdit editors.
I've attached a video showing my actions with your EXE.
Did I miss any steps to reproduce the issue? If so, please describe them.
Hello Mikhail
Run like this:
In the first item, open the calendar and click Now
The memo will contain
08/26/2020 10:48:14 AM: Component deDateTime fired event OnEditValueChanged
Select the second item or memo
To appear in the memo
08/26/2020 10:48:14 AM: Component deDateTime fired event OnEditValueChanged
08/26/2020 10:48:17 AM: Component deDateTime fired event OnEditValueChanged
08/26/2020 10:48:17 AM: Component deDateTime fired event OnExit
Include video for example.
Hello Ilya,
Thank you for the clarification. I've replicated the issue with the "Now" button. We will examine this behavior, but this will take us some time.
Would you mind if we publish this ticket, so that other customers could find this thread? We can protect the privacy of your data by removing your attachment.
Just let us know if it has to be removed.
I'm not against. Changed to public
Hello, Mikhail
Do you have any news?
Hello Ilya,
Our developers are still working on this issue.
I am afraid we cannot give you a precise time frame as to when it will be fixed.
Hello, Mikhail
How do I get the fix? I requested on the form below, but for 2 days there is nothing, only the text "* 20.1.6Hotfix requested and is being prepared"
Hello Ilya,
We don't provide hotfixes for outdated versions. Nevertheless, you can try applying the following code fix:
procedure TcxCustomDateEdit.DateChange(Sender: TObject); var ADate: Double; ADisplayValue: TcxEditValue; begin BeginUserAction; try FCloseUpReason := crEnter; ADate := Calendar.SelectDate; if ActiveProperties.Kind = ckDateTime then ADate := dxDateOf(ADate) + cxSign(ADate) * dxTimeOf(TDateTime(Calendar.Time)) else if ActiveProperties.SaveTime and (ADate <> NullDate) then if ADate >= 0 then ADate := ADate + dxTimeOf(FDateDropDown) else ADate := ADate - dxTimeOf(FDateDropDown); ADisplayValue := GetRecognizableDisplayValue(ADate); if ((Date <> ADate) or not InternalCompareString(DisplayText, VarToStr(ADisplayValue), True)) and DoEditing then begin LockChangeEvents(True); try if ADate = NullDate then Date := ADate else Date := VarToDateTime(DateTimeToTextEx(ADate, False)); ModifiedAfterEnter := True; SetInternalDisplayValue(ADisplayValue); SelectAll; finally LockChangeEvents(False); end; end; finally EndUserAction; end; end;