This is a migrated thread and some comments may be shown as answers.

Event next month of DateTimePicker

7 Answers 266 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
laki
Top achievements
Rank 1
laki asked on 08 Mar 2011, 10:02 AM
Hello !

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

Thank you!

7 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 Mar 2011, 04:28 PM
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!
0
laki
Top achievements
Rank 1
answered on 17 Mar 2011, 03:44 AM
Thank you !

But I use control RadDateTimePicker.
Help me!
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 17 Mar 2011, 09:04 PM
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
0
laki
Top achievements
Rank 1
answered on 18 Mar 2011, 02:20 AM
Thanks Richard Slade !
0
Hugo Furth
Top achievements
Rank 1
answered on 31 Jul 2014, 12:14 AM
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
0
Stefan
Telerik team
answered on 31 Jul 2014, 06:31 AM
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.
 
0
Hugo Furth
Top achievements
Rank 1
answered on 23 Aug 2014, 01:56 AM
Very much appreciated. Sorry for delayed thanks.

Hugo
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
laki
Top achievements
Rank 1
Answers by
Stefan
Telerik team
laki
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Hugo Furth
Top achievements
Rank 1
Share this question
or