Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread TDateEditComboBox.selectedDate.. not updating when manually editing
Fri, Mar 20 2020 1:21 AMPermanent Link

Bruno Larochelle

EWB3 Build 7..

If I manually edit a date in a TDateEditComboBox.. then the 'selectedDate' property is not updated (actually.. always gives 'today'). I checked to see if the 'OnChange' event was firing when manually editing.. and it is.

If I use the drop-down calendar, then the 'selectedDate' property is updated.

EWB2 Build 11..

This works fine (for me). I have a simple test, no dataset tied to the control. We have used the TDateEditComboBox in many other projects, never encountered a problem with it.


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////// This was recently reported by Matthew Jones in the general forum (not beta) //////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Matthew confirmed this behavior was with EWB2 (not sure which build, or whether he had a dataset tied to it).

https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&msg=16164&page=1

I have a TDateEditComboBox on my form. I can type a date and it sits there happily. But if I ask for "SelectedDate" then it gives me today, and not the date typed in. If I select a date using the drop down, SelectedDate gives me that date. Can the combo automatically interpret the typed date, or must I code it myself?

--

Matthew Jones
Fri, Mar 20 2020 1:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Bruno,

<< If I manually edit a date in a TDateEditComboBox.. then the 'selectedDate' property is not updated (actually.. always gives 'today'). I checked to see if the 'OnChange' event was firing when manually editing.. and it is. >>

This is really an issue of how the edit controls update.  Yes, the OnChange event fires, but EWB does not try to set the SelectedDate property until the user leaves the edit or the dataset row is saved (in the case of a bound control).  So, if you don't tab out of the control, then the SelectedDate won't get updated.

I'll see what I can do about changing this behavior for EWB 3.

Tim Young
Elevate Software
www.elevatesoft.com
Image