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

Timepicker Expand?

10 Answers 154 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 24 Nov 2008, 02:02 PM
Is there a way when setting an appointment to have the time picker expanded to show more than just 8:00 am to 5:30 pm?

10 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 25 Nov 2008, 03:45 PM
Hi Jim,

Currently, there is no direct way to set the start/end times of the TimePickers. We have this logged as a feature request and will implement it in an upcoming version of RadScheduler. At this time you can use a workaround - handle the FormCreated event and use the following code to find the TimePickers and set the relevant properties:

protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e) 
    if (e.Container.Mode != SchedulerFormMode.AdvancedInsert && e.Container.Mode != SchedulerFormMode.AdvancedEdit) 
        return; 
 
    RadTimePicker startTimePicker = ((RadTimePicker)e.Container.FindControl("StartTime")); 
    startTimePicker.TimeView.StartTime = TimeSpan.FromHours(6); 
    startTimePicker.TimeView.EndTime = TimeSpan.FromHours(21); 
    startTimePicker.TimeView.DataList.DataSource = null
    startTimePicker.TimeView.DataBind(); 
 
    RadTimePicker endTimePicker = ((RadTimePicker)e.Container.FindControl("EndTime")); 
    endTimePicker.TimeView.StartTime = TimeSpan.FromHours(6); 
    endTimePicker.TimeView.EndTime = TimeSpan.FromHours(21); 
    endTimePicker.TimeView.DataList.DataSource = null
    endTimePicker.TimeView.DataBind(); 


Best wishes,
Dimitar Milushev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
kyle goodfriend
Top achievements
Rank 2
answered on 19 Jan 2009, 06:58 PM
I was directed to this post by Telerik support.  I am using the most recent build and there is a bug with the params for daystarttime/endtime.

I converted to VB.  It won't allow me to use null, so I used double quotes.
            Dim startTimePicker As RadTimePicker = e.Container.FindControl("StartTime") 
            startTimePicker.TimeView.StartTime = TimeSpan.FromHours(6) 
            startTimePicker.TimeView.EndTime = TimeSpan.FromHours(21) 
            startTimePicker.TimeView.DataList.DataSource = "" 
            startTimePicker.TimeView.DataBind() 
 
            Dim endTimePicker As RadTimePicker = e.Container.FindControl("EndTime") 
            endTimePicker.TimeView.StartTime = TimeSpan.FromHours(6) 
            endTimePicker.TimeView.EndTime = TimeSpan.FromHours(21) 
            endTimePicker.TimeView.DataList.DataSource = "" 
            endTimePicker.TimeView.DataBind() 
 

When trying to implement, I get the following error.

Provided DataSource for timeView is not supported

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Provided DataSource for timeView is not supported

Any guidance?  If this bug will be fixed in the next release, I don't mind waiting if this is going to be a pain.



0
Peter
Telerik team
answered on 20 Jan 2009, 12:57 PM

In VB.NET the key word null is translated to 'Nothing'. I have converted the c# code to VB.NET:

Protected Sub RadScheduler1_FormCreated(sender As Object, e As Telerik.Web.UI.SchedulerFormCreatedEventArgs)  
    If e.Container.Mode <> SchedulerFormMode.AdvancedInsert AndAlso e.Container.Mode <> SchedulerFormMode.AdvancedEdit Then 
        Return 
    End If 
 
    Dim startTimePicker As RadTimePicker = (DirectCast(e.Container.FindControl("StartTime"), RadTimePicker))  
    startTimePicker.TimeView.StartTime = TimeSpan.FromHours(6)  
    startTimePicker.TimeView.EndTime = TimeSpan.FromHours(21)  
    startTimePicker.TimeView.DataList.DataSource = Nothing 
    startTimePicker.TimeView.DataBind()  
 
    Dim endTimePicker As RadTimePicker = (DirectCast(e.Container.FindControl("EndTime"), RadTimePicker))  
    endTimePicker.TimeView.StartTime = TimeSpan.FromHours(6)  
    endTimePicker.TimeView.EndTime = TimeSpan.FromHours(21)  
    endTimePicker.TimeView.DataList.DataSource = Nothing 
    endTimePicker.TimeView.DataBind()  
End Sub 
 

Do you still experience problems with this code?

Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
kyle goodfriend
Top achievements
Rank 2
answered on 23 Jan 2009, 03:10 AM
As always, thank a million for sharing your knowledge.  This worked to perfection.
0
Peter Briggs
Top achievements
Rank 1
answered on 17 Mar 2010, 04:23 PM
Does this still have to be done for RadControls in the 2009.3 version?
0
Peter
Telerik team
answered on 17 Mar 2010, 04:56 PM
Hi Peter,

Thank you for your question. Unfortunately, yes, you still need this workaround with Q3 2009 and Q1 2010.

Regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jim
Top achievements
Rank 1
answered on 23 Mar 2011, 11:38 PM
Is this still the case for Q1 2011 Release.  Also is there a client side example?
0
Peter
Telerik team
answered on 25 Mar 2011, 05:10 PM
Hello James,

Thank you for your inquiry. Indeed, this task was with low priority so it never got a chance to be fixed. Anyway, I will bookmark this thread and increase the priority.

Can you clarify what exactly you mean by a client side example?


All the best,
Peter
the Telerik team
0
Jim
Top achievements
Rank 1
answered on 28 Mar 2011, 05:55 PM
I am using the Scheduler with Web Service Binding so I am using the OnClientFormCreated Function versus the Server Side OnFormCreated.  And since I am using Web Service the Server Side OnFromCreated does not get fired (which makes perfect sense).  I was hoping to see an OnClientFormCreated example or workaround. 

Here is what I have so far, but is not working:
function OnClientFormCreated(sender, eventArgs) {
                var tpStart = $find('<%= RadScheduler1.ClientID + "_AdvancedInsertForm_StartTime" %>');
                var tvStart = tpStart.get_timeView();
                alert(tvStart.get_startTime());
                tvStart.set_startTime("06:00:00");                
            }

 

0
Peter
Telerik team
answered on 30 Mar 2011, 01:01 PM
Hello James,

Thanks for clarifying.

I don't think this can be achieved client side. Please, accept our apologies for this limitation of RadScheduler.

Regards,
Peter
the Telerik team
Tags
Scheduler
Asked by
Jim
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
kyle goodfriend
Top achievements
Rank 2
Peter
Telerik team
Peter Briggs
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Share this question
or