Timepicker Expand?

11 posts, 0 answers
  1. Jim
    Jim avatar
    2 posts
    Member since:
    Nov 2008

    Posted 24 Nov 2008 Link to this post

    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?
  2. Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 25 Nov 2008 Link to this post

    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.
  3. kyle goodfriend
    kyle goodfriend avatar
    53 posts
    Member since:
    Mar 2007

    Posted 19 Jan 2009 Link to this post

    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.



  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 20 Jan 2009 Link to this post


    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.
  5. kyle goodfriend
    kyle goodfriend avatar
    53 posts
    Member since:
    Mar 2007

    Posted 22 Jan 2009 Link to this post

    As always, thank a million for sharing your knowledge.  This worked to perfection.
  6. Peter Briggs
    Peter Briggs avatar
    14 posts
    Member since:
    Mar 2010

    Posted 17 Mar 2010 Link to this post

    Does this still have to be done for RadControls in the 2009.3 version?
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 17 Mar 2010 Link to this post

    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.
  8. Jim
    Jim avatar
    7 posts
    Member since:
    Oct 2012

    Posted 23 Mar 2011 Link to this post

    Is this still the case for Q1 2011 Release.  Also is there a client side example?
  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 25 Mar 2011 Link to this post

    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
  10. Jim
    Jim avatar
    7 posts
    Member since:
    Oct 2012

    Posted 28 Mar 2011 Link to this post

    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");                
                }

     

  11. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 30 Mar 2011 Link to this post

    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
Back to Top