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

Date Picker Start of Week

3 Answers 234 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
jrit
Top achievements
Rank 1
jrit asked on 31 Aug 2008, 02:54 AM
It seems the new date picker that is available does not use the FirstDayOfWeek that is specified on the scheduler, its very confusing to have the scheduler start on Monday but the date picker start on Sunday.


3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 01 Sep 2008, 02:34 PM
Hello Jarrett,

You can easily achieve what you are after using the following code:

protected void Page_PreRender(object sender, EventArgs e)  
    {  
        if (RadScheduler1.SelectedView == Telerik.Web.UI.SchedulerViewType.WeekView)  
        {  
            RadDatePicker selectedDatePicker = (RadDatePicker)RadScheduler1.FindControl("SelectedDatePicker");  
            if (selectedDatePicker != null)  
            {  
                selectedDatePicker.SelectedDate = RadScheduler1.VisibleRangeStart;  
            }  
        }  
    } 

Note, that I use Pre_Render because it occurs is late enough and setting the datepicker's SelectedDate property does not affect RadScheduler.



Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
jrit
Top achievements
Rank 1
answered on 01 Sep 2008, 06:47 PM
Thank you. That wasn't exactly my question. I'm sure you know that exposing the control directly instead of having to use a findcontrol and cast would be preferable. What I actually wanted to do is

selectedDatePicker.Calendar.FirstDayOfWeek = (FirstDayOfWeek)RadScheduler1.FirstDayOfWeek;

I guess the issue is that the FirstDayOfWeek for the datepicker should in the case that it is part of the scheduler control default to the FirstDayOfWeek on the scheduler control instead of the FirstDayOfWeek defined by the localization on the current thread.
0
Peter
Telerik team
answered on 02 Sep 2008, 10:03 AM

Thanks for clarifying. I will forward your suggestion to our developers who will consider it.


Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
jrit
Top achievements
Rank 1
Answers by
Peter
Telerik team
jrit
Top achievements
Rank 1
Share this question
or