Start and End TimePickers not visible from Timeline View

5 posts, 0 answers
  1. davidp
    davidp avatar
    11 posts
    Member since:
    Jun 2012

    Posted 23 Aug 2012 Link to this post

    When I attempt to edit an existing appointment or create a new appointment using the Advanced Insert/Edit forms while in the TimeLine View (also Month View) I am unable to see the timepickers for the start and end times.  However, the timepickers are available from the week and day views.  How can I make these available from the timeline view?
  2. davidp
    davidp avatar
    11 posts
    Member since:
    Jun 2012

    Posted 27 Aug 2012 Link to this post

    Any ideas?
  3. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 28 Aug 2012 Link to this post

    Hi David,

    If you need to show the time pickers in timeline View as well as in the month View, you could do the following:
    1. Subscribe to the FormCreated server event of RadScheduler;
    2. Add the following code in it:
    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        if ((sender as RadScheduler).SelectedView == SchedulerViewType.TimelineView)
        {
            if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
            {
                (e.Container.FindControl("AllDayEvent") as CheckBox).Checked = false;
            }
        }
    }
    <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="TimelineView" OnFormCreated="RadScheduler1_FormCreated">
    </telerik:RadScheduler>

    I hope this will help.

    Regards,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  4. davidp
    davidp avatar
    11 posts
    Member since:
    Jun 2012

    Posted 29 Aug 2012 Link to this post

    I converted the code to vb and added it to my project.  When I attempt to create or edit an appointment I get a NullReferenceException stating that an "object reference is not set to an instance of an object" while in debug pointing at the line in bold below.  

    Protected Sub RadScheduler1_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs)
                If TryCast(sender, RadScheduler).SelectedView = SchedulerViewType.TimelineView Then
                    If e.Container.Mode = SchedulerFormMode.AdvancedInsert Then
                        TryCast(e.Container.FindControl("AllDayEvent"), CheckBox).Checked = False
                    End If
                End If
    End Sub

  5. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 03 Sep 2012 Link to this post

    Hello David,

    I have attached a sample page which works good at my end. Would you give it a try locally and tell me if the described error still occurs? Also, what it the version of RadControls for ASP.NET AJAX that you use in your application?

    All the best,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top