[Bug] RadDateTime Control Requires extra click when selecting a date

6 posts, 0 answers
  1. Pawz
    Pawz avatar
    51 posts
    Member since:
    Aug 2007

    Posted 14 Sep 2008 Link to this post

    There's this odd bug/inconsitency I've been noticing with the latest DateTimePicker control. When you load the form initially, the very first time you click on a DateTimePicker to drop down the calendar and select a date, you must click on the date *twice* before the control will commit the selection.

    Every selection after this will be immediately made (only two clicks required - drop down arrow & calendar number).

    This feature has already tripped up some of my beta users - is there a way I can eliminate that first extra click?
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 18 Sep 2008 Link to this post

    Hi Pawz,

    Indeed, this is something we have to fix. There is a workaround for this, which you can use until we fix the problem:

    1. Subscribe to the SelectionChanged event of RadDateTimePicker's built in RadCalendar

          (this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).Calendar.SelectionChanged += new EventHandler(Form1_SelectionChanged);
         
    2. Hide the PopUp when a selection has been made.

     void Form1_SelectionChanged(object sender, EventArgs e)
            {
                (this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).PopupControl.HideControl();
                this.radDateTimePicker1.Value = (this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).Calendar.SelectedDate;
            }

    Please contact me again if there is something I can help with.

    Kind regards,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mark Davidson
    Mark Davidson avatar
    1 posts
    Member since:
    Apr 2003

    Posted 29 Sep 2008 Link to this post

    Any update as to when this will be fixed.

    I have a form that has 10+ RadDateTimePickers on it and I don't want to create an eventhandler for everyone. I tried to generalize the function like I have for setting the FocusDate of the RadDateTimePickerCalendar.Calendar.FocusedDate, but I haven't had much luck.  What I was trying to do was use the Enter event to create a selectionchanged event handler based on the sender argument. The problem I have is that when I handle the selectionchanged event the sender is RadCalendar which doesn't have the ability as far as I can tell to close the popup. See code below for what I was trying to accomplish before I discovered that the sender was RadCalendar.

    private void radDateTimePicker_Enter(object sender, EventArgs e)
    {
    (((Telerik.WinControls.UI.
    RadDateTimePicker)sender).DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).Calendar.SelectionChanged += new EventHandler(radDateTimePickerCalendar_SelectionChanged);
    }

    void

    radDateTimePickerCalendar_SelectionChanged(object sender, EventArgs e)
    {
    (((Telerik.WinControls.UI.
    RadDateTimePicker)sender).DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).PopupControl.HideControl();
    }

  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 02 Oct 2008 Link to this post

    The issue is in our TO DO list, Mark, and we will do our best to fix it for the Q3 release of RadControls for WinForms - hopefully the resources will permit us to do so. However you can subscribe to only one event handler in a loop and then in the handler you can call in a loop through all datetimepickers in your form to close their popups.


    All the best,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Dipak
    Dipak avatar
    19 posts
    Member since:
    Oct 2008

    Posted 26 Nov 2008 Link to this post

    I am generating DateTimePicker control at runtime. This code is not working in my project could you please provide me work arrount for this?

    Dipak Polra
  7. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 28 Nov 2008 Link to this post

    Hi Dipak,

    In a few days we will release Q3 SP1 and you won't need to write any additional code to hide the calendar popup. However, let me explain the code:

    1. The following code hides the popup
    (((Telerik.WinControls.UI.RadDateTimePicker)sender).DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).PopupControl.HideControl();

    2. We want the popup to be hidden on calendar's selection change. That is why I subscribe to the SelectionChanged event and call the HideControl method event's handler.

     
    Kind regards,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready