Showing the time on a Timeline View

2 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 12 Jan 2012 Link to this post

    Does anyone have any idea how I might show the current time in a timeline view?

    I'm not talking about the header. I have a client who wants to see a view of the day in timeline view with a marker showing the place in the day, like this.

    I know it can't be done out of the box, but I was wondering if anyone out there had any ideas about how it might be achieved.

  2. Plamen
    Plamen avatar
    2723 posts

    Posted 17 Jan 2012 Link to this post

    Hello Stuart,

    We thought of a possible workaround for this scenario by adding a new appointment that will show the current time. Here is the code that I used:

    <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="TimelineView"
            TimelineView-ShowInsertArea="false" GroupBy="Room" GroupingDirection="Vertical"
            OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" EnableExactTimeRendering="true">
    protected void Page_Load(object sender, EventArgs e)
           if (!IsPostBack)
               Appointment app = new Appointment();
               app.Subject = "Test";
               app.Start = DateTime.Now;
               app.End = DateTime.Now.AddMinutes(1);
       protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
           if (e.Appointment.Subject=="Test")
               e.Appointment.Start = DateTime.Now;
               e.Appointment.End = DateTime.Now.AddMinutes(1);
               e.Appointment.AllowDelete = false;
               e.Appointment.AllowEdit = false;
               e.Appointment.BackColor = System.Drawing.Color.Red;
               e.Appointment.BorderColor = System.Drawing.Color.Red;
               Resource r = RadScheduler1.Resources.GetResourceByType("Room");

    Hope this will be helpful. 

    Plamen Zdravkov
    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
  3. DevCraft R3 2016 release webinar banner
Back to Top