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

Custom Header on slot duration

2 Answers 38 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ashok
Top achievements
Rank 1
Ashok asked on 31 May 2012, 09:29 PM
HI,
I am using TimeLine view on RadSchedular. Following is the code. time duration slot is for 2 Week.
I want to show column header as ( Week Start date- Week End date) . example - 05/31/2012 - 06/13/2012.
See attachment also. Is it possible to do that?

RadScheduler1.SelectedView = SchedulerViewType.TimelineView;
RadScheduler1.TimelineView.SlotDuration = TimeSpan.Parse("14.00:00:00");
RadScheduler1.TimelineView.ColumnHeaderDateFormat = "MM/dd/yyyy";
RadScheduler1.ColumnWidth = 180;
RadScheduler1.TimelineView.TimeLabelSpan = 1;
RadScheduler1.TimelineView.NumberOfSlots = 6;

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 04 Jun 2012, 08:33 AM
Hello Ashok,

 
It can not be achieved with the inbuilt functionality of RadScheduler but you can use jQuery and javascript as in the code below:

function pageLoad(sender, args) {
           var $ = $telerik.$;
           $(".rsHorizontalHeaderTable th").each(function(index, element) {
               var startDateString = element.textContent.trim();
               var splitedDate = startDateString.split('/');
               var start = new Date(splitedDate[2], splitedDate[0], splitedDate[1], 0, 0, 0, 0);
               var end = new Date();
               end.setDate(start.getDate() + 14);
               var endDateString = end.format("MM/dd/yyyy");
               element.textContent = startDateString + "-" + endDateString;
           });
       }

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.
0
Ashok
Top achievements
Rank 1
answered on 06 Jun 2012, 03:50 PM
This worked for me. Thanks a lot.
Tags
Scheduler
Asked by
Ashok
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Ashok
Top achievements
Rank 1
Share this question
or