RadDateTimePicker behaviour...

4 posts, 1 answers
  1. Mike
    Mike avatar
    9 posts
    Member since:
    Apr 2009

    Posted 04 Jun 2009 Link to this post

    Hi there,

    Just a comment really, when using a rad datetime picker, it might be useful to be able to catch some event based on the date that a user has selected.  

    The problem is that with the select/unselect behaviour of the calendar in the datepicker, there is an inbetween event "valuechanged" fired, with the date at that point being "1 January 1980", or datemin, so you can't really attach anything directly to that event without fudging it... 

    Now I understand the select/unselect of a calendar is why this behaviour exists, but realistically, when using a datepicker control, WHY would anyone want that inbetween date? Surely we're only ever interested in the date that the user has selected? This feels to me like seeing unecessarily the mechanics of the control?

    Would it not be possible to segregate the events into a "real" ValueChanged event which would only fire once the 
    transaction (if you like) of changing to mindate and then to the actual date clicked on had completed and then relegate the current ValueChanged to something more accurate like "CalendarSelectionChanged"? 

    I think that a datepicker control should allow me to capture what the user has actually selected without having to filter out spurious events.

    Incidentally, how DOES one filter out that spurious event when the date selected happens to be the minimum date? Does your control fire valuechanged twice, both times with the same (mindate) value in the Value property?

    Kind regards,
  2. Answer
    Boyko Markov
    Boyko Markov avatar
    610 posts

    Posted 05 Jun 2009 Link to this post

    Hello Mike,

    ValueChanged event is fired only when the Value(a DateTime object) is changed. If you set it to a value between MinDate and MaxDate the event will be fired. The event will be fired when you select a value different than the current one. The event will also fire when you select the NullDate (which is in sync with the MinDate by default). I understand that select/unselect of RadCalendar is a behavior which does not fit well in the case of RadDateTimePicker because users shouldn't be allowed to unselect a date, but just select it.
    We will consider changing this behavior for the next major release.

    Thank you for the feedback. Please contact me again if you have any other questions.

    Sincerely yours,
    Boyko Markov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft R3 2016 release webinar banner
  4. AndreaT
    AndreaT avatar
    27 posts
    Member since:
    Sep 2007

    Posted 01 Aug 2012 Link to this post


    as of versione 2011 Q3 the ValueChanged event is also fired when the control looses focus regardeless the real value was changed or not. You can test this simply moving between controls using TAB key without doing anything else: the event is raised and to me it is a bug.

    kind regards

  5. Peter
    Peter avatar
    1148 posts

    Posted 06 Aug 2012 Link to this post

    Hello Andrea,

    Thank you for contacting us.

    We are aware of this issue. It was fixed in our Q1 2012 SP1 release. I cannot propose a workaround for your version because the issue is located deeply in the internal control logic.

    I will suggest to upgrade your project to our latest version in order to take advantage of the fix.

    I hope that you find this information useful. Do not hesitate to contact us if you have other questions. 

    Kind regards,
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top