This project has moved. For the latest updates, please go here.

DateTimePicker.ValueChanged event

Jul 24, 2012 at 10:20 AM

I notice that this event triggers twice. Is this by design or is it an error?

It is a tad annoying when the event is used for retrieving data from a backend repository, causing the data to be retrieved twice.

--norgie

Developer
Aug 7, 2012 at 1:05 PM

-DateTimePicker derives from
-DateTimeUpDown, which derives from
-UpDownBase


Changing Value will raise the ValueChanged event for DateTimePicker but also from DateTimeUpDown.

But when creating a DateTimePicker, we will receive only the ValueChanged event from DateTimePicker. The same way, when creating a DateTimeUpDown, we will receive only the ValueChanged event from DateTimeUpDown.

How can you receive the event twice ?

Sep 21, 2012 at 12:58 PM

This behavior is also what I have observed and it's really annoying :)

 

You can reproduce it in like 5 minutes:

- Create new WPF project

- Add DateTimePicker

- Attach event handler

- Write some statement inside the handler and put a breakpoint on it

- Run the program and choose a date from the datetimepicker, you will see that the event handler is invoked twice

 

When manipulating through the Value property this does not happen, so everything works correctly then.

When using the up and down arrows on a portion of the datetime this does not happen, work correctly too.

 

This behavior is still inside the (new) release v1.7.

 

Kind regards,

Dwight

Sep 24, 2012 at 2:02 PM

The issue 18695 was created based on this discussion

Sep 24, 2012 at 2:04 PM

This last issue has been closed, the Issue 18680 describing the problem was already created.