Event next month of DateTimePicker

8 posts, 1 answers
  1. laki
    laki avatar
    5 posts
    Member since:
    Dec 2010

    Posted 08 Mar 2011 Link to this post

    Hello !

    When I click small button (>), it will changed to other month. What's that event ? I want use it.

    Thank you!
  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 10 Mar 2011 Link to this post

    Hi laki,

    Thank you for writing.

    You can subscribe for the Click events of those buttons. Here is how you can access them:
    radCalendar1.CalendarElement.NextButton.Click += new EventHandler(NextButton_Click);
    radCalendar1.CalendarElement.PreviousButton.Click += new EventHandler(PreviousButton_Click);
     
    I hope this helps.

    Greetings,
    Stefan
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. laki
    laki avatar
    5 posts
    Member since:
    Dec 2010

    Posted 16 Mar 2011 Link to this post

    Thank you !

    But I use control RadDateTimePicker.
    Help me!
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 17 Mar 2011 Link to this post

    Hello,

    There is only a small addition needed to the code provided in order to adapt this for a RadDateTimePicker.

    You need to get to the CalendarElement from the RadDateTimePicker. Please consider the following code

    RadDateTimePickerCalendar dateTimePickerCalendar = (RadDateTimePickerCalendar)this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior();
    dateTimePickerCalendar.Calendar.CalendarElement.NextButton.Click += new EventHandler(NextButton_Click);
    dateTimePickerCalendar.Calendar.CalendarElement.PreviousButton.Click += new EventHandler(PreviousButton_Click);

    void PreviousButton_Click(object sender, EventArgs e)
    {
        // do something
    }
    void NextButton_Click(object sender, EventArgs e)
    {
        // do something
    }

    Hope that helps, but let me know if you need more information
    Richard
  6. laki
    laki avatar
    5 posts
    Member since:
    Dec 2010

    Posted 17 Mar 2011 Link to this post

    Thanks Richard Slade !
  7. Hugo Furth
    Hugo Furth avatar
    31 posts
    Member since:
    Dec 2008

    Posted 30 Jul 2014 in reply to Richard Slade Link to this post

    Rather than hooking the event, is there a way to change the the +/- rate for the arrows? For example, The fast forward/backward buttons default to +/- 3 months. I'd like to set them to a year as is a more common default.

    Thanks,
    Hugo
  8. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 31 Jul 2014 Link to this post

    Hello Hugo,

    You can alter the navigation step via the FastNavigationStep property:
    radDateTimePicker1.DateTimePickerElement.Calendar.FastNavigationStep = 12;

    I hope this helps.

    Regards,
    Stefan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  9. Hugo Furth
    Hugo Furth avatar
    31 posts
    Member since:
    Dec 2008

    Posted 22 Aug 2014 in reply to Stefan Link to this post

    Very much appreciated. Sorry for delayed thanks.

    Hugo
Back to Top
UI for WinForms is Visual Studio 2017 Ready