Custom Header on slot duration

3 posts, 0 answers
  1. Ashok
    Ashok avatar
    6 posts
    Member since:
    Feb 2012

    Posted 31 May 2012 Link to this post

    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. Plamen
    Admin
    Plamen avatar
    2969 posts

    Posted 04 Jun 2012 Link to this post

    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.
  3. Ashok
    Ashok avatar
    6 posts
    Member since:
    Feb 2012

    Posted 06 Jun 2012 Link to this post

    This worked for me. Thanks a lot.
Back to Top