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

Getting the right month in Monthview

1 Answer 45 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Espen Fosshaug
Top achievements
Rank 1
Espen Fosshaug asked on 04 Feb 2012, 09:01 PM
Hi.

In monthview the name of the month that is displayed in the header. This is always right even if the first day in the view is from the previous month.
I need to get this! 
VisibleRangeStart.Month gets the previous month, and selecteddate.month looks random.

I need this because I am creating a MonthPlan as a pdf that starts on the first monday of the Month. This is created from the displayed month. I can find the first monday, but I need to be on the correct month.

Please help.

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 08 Feb 2012, 05:10 PM
Hi,

Try to subscribe to the NavigationComplete event, and get the SelectedDate out of RadScheduler in the event handler. The currently selected month is always accurate in this method when a navigation occurs.
private DateTime currentDate;
protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
{
    currentDate = RadScheduler1.SelectedDate;
}

I hope this helps.

All the best,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Scheduler
Asked by
Espen Fosshaug
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or