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

Showing the time on a Timeline View

1 Answer 63 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 12 Jan 2012, 02:17 PM
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.

--
Stuart

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 17 Jan 2012, 12:17 PM
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">
    </telerik:RadScheduler>
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");
           e.Appointment.Resources.Add(r);
       }
   }

Hope this will be helpful. 


Regards,
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
Tags
Scheduler
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Share this question
or