Month(and week) columns in timeline view

16 posts, 0 answers
  1. Steffen
    Steffen avatar
    9 posts
    Member since:
    May 2007

    Posted 24 Mar 2011 Link to this post

    Hi,

    The new ScheduleView looks really great. However is it possible to have month and possible week names in columns above the day names in timeline view? Much like the attached sketch.
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 24 Mar 2011 Link to this post

    Hello Steffen,

    Currently we support only days as headers and time in the second line. The functionality you request is in our plans and we will do our best to provide it for Q2 2011 or shortly after.

    Regards,
    Valeri Hristov
    the Telerik team
  3. DevCraft banner
  4. Paul
    Paul avatar
    4 posts
    Member since:
    Jul 2011

    Posted 15 Jul 2011 Link to this post

    Did this make it in the Q2 release?
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 15 Jul 2011 Link to this post

    Hello Paul,

    Unfortunately this feature did not made it into the Q2 release. It is with high priority on our list and will be included in one of the next service packs.

    Regards,
    Valeri Hristov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Alex
    Alex avatar
    3 posts
    Member since:
    May 2011

    Posted 29 Sep 2011 Link to this post

    Hi Valeri,

    We were looking forward to seeing this feature in the SP1 release as below:
    http://www.telerik.com/community/forums/silverlight/scheduleview/calendar-scheduleview.aspx

    Could you give us some light on when the next release is scheduled and when the feature will be included?
    This is very important to us, we will need to consider timing and other options with the information you provide us

    Kind Regards
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 04 Oct 2011 Link to this post

    Hello Alex,

    Here is how to use the new functionality:
    <telerik:RadScheduleView>
     <telerik:RadScheduleView.AppointmentsSource>
      <telerik:ObservableAppointmentCollection />
     </telerik:RadScheduleView.AppointmentsSource>
     <telerik:RadScheduleView.ViewDefinitions>
      <telerik:TimelineViewDefinition VisibleDays="30" MinTimeRulerExtent="5000" MajorTickLength="1day"
        GroupTickLength="1week" TimerulerMajorTickStringFormat="{}{0:d}" MinorTickLength="1day">
      </telerik:TimelineViewDefinition>
     </telerik:RadScheduleView.ViewDefinitions>
    </telerik:RadScheduleView>

    Best wishes,
    Valeri Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 13 Oct 2011 Link to this post

    Hi,

    My ViewDefinition looks like this:
    <telerik:TimelineViewDefinition x:Name="ScheduleViewDefinition" Title="Schema" Orientation="Horizontal" VisibleDays="7" MinorTickLength="1day" MajorTickLength="1day" GroupTickLength="1week" TimerulerGroupStringFormat="{}{0:dddd %d MMMM}" TimerulerMajorTickStringFormat="{}{0:dddd}" StretchGroupHeaders="True" AppointmentFilter="{Binding AppointmentsFilter}" />

    But my group header says "monday 10 october - monday 17 october"
    I guess it's becaude the VisibleRange.End is "2011-10-17 00:00:00".

    I want it to display "monday 10 october - sunday 16 october".

    Regards,
    Håkan




  9. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 13 Oct 2011 Link to this post

    Hello Håkan,

    As far as I can see this is a bug, that should be fixed. Meanwhile you could implement the ITickLength interface on a new class and provide a custom format string for the timeruler groups. For example, a implementation that is nearly the same as the default follows and I suppose the problem is in the highlighted line:
    public class CustomTickProvider : ITickProvider
    {
     public CustomTickProvider()
     {
      this.Interval = new DateTimeInterval(0, 0, 1);
     }

     public DateTimeInterval Interval
     {
      get;
      set;
     }

     public DateTime GetNextStart(TimeSpan tickLength, DateTime currentStart)
     {
      if (this.Interval.Days > 0)
      {
       return AddInterval(currentStart.Date, this.Interval);
      }
      return AddInterval(currentStart, this.Interval);
     }

     public string GetFormatString(IFormatProvider formatInfo, string viewDefinitionFormatString, DateTime currentStart)
     {
      if (this.Interval.Days > 1 || this.Interval.Weeks > 0 || this.Interval.Months > 1)
      {
       return string.Format(formatInfo, viewDefinitionFormatString + "  -  " + viewDefinitionFormatString.Replace("0:", "1:"), currentStart, currentStart.AddInterval(this.Interval));
      }
      return string.Format(formatInfo, viewDefinitionFormatString, currentStart);
     }

     private static DateTime AddInterval(DateTime date, DateTimeInterval dateTimeInterval)
     {
      return date.AddMinutes(dateTimeInterval.Minutes).AddHours(dateTimeInterval.Hours).AddDays(dateTimeInterval.Days).AddDays(dateTimeInterval.Weeks * 7).AddMonths(dateTimeInterval.Months);
     }
    }

    You could use the provider like this:
    <telerik:TimelineViewDefinition>
        <telerik:TimelineViewDefinition.GroupTickLength>
            <local:CustomTickProvider />
        </telerik:TimelineViewDefinition.GroupTickLength>
    </telerik:TimelineViewDefinition>

    Kind regards,

    Valeri Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  10. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 10 Jan 2012 Link to this post

    Hi Valerie!

    Are there any changes in the Q3 release that will break the provided code example?
    Because when I try this CustomTickProvider I get som compilation errors.

    It seems DateTimeInterval doesn't contain a Weeks property.
    It also complained at currentStart.AddInterval because of its protection level.
    I used the private static method instead, seemed to work.

    I tried to remove everything using the Weeks property. But that hanged the application, causing an Out of memory exception after awhile.
    I set a breakpoint in the constructor of the CustomTickProvider and found that since there is no Weeks the Interval was set to 0.
    I changed it so that it would be initialized with 7 days instead and then it seems to work.

    Finally I added .AddSeconds(-1) to the AddInterval method and then the date range was displayed correctly.

    Is this confirmed to be a bug, and in that case, what is the release plan on the fix?

    Regards,
    Håkan


  11. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 16 Jan 2012 Link to this post

    Hi Hakan,

    I apologize, I pasted a snippet from the original ScheduleView source code, and it appears that it uses properties and methods that are internal. The code didn't work on the first place, which is my mistake.

    You could leave the DateTimeInterval and just create a couple of ITickProvider implementations - one for weeks and one for months. Please, find attached a sample application that works with the latest binaries.

    All the best,
    Valeri Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  12. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 16 Jan 2012 Link to this post

    Thanks Valeri!

    That was a much cleaner solution.

    Regards,
    Håkan
  13. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 06 Mar 2012 Link to this post

    Hi again!

    I found an issue with this solution...

    If I set visible days to for example 14 and use the WeeklyTickProvider, it always displays a whole week even though the first day is not a monday (First day of week is set to monday).
    See attached image where first day in the interval is a thursday and the last day is a wednesday.

    This is understandable since the code in the WeeklyTickProvider looks like this:

    public DateTime GetNextStart(TimeSpan tickLength, DateTime currentStart)
           {
               DateTime weekStart = CalendarHelper.GetFirstDayOfWeek(currentStart, DayOfWeek.Monday);
               return weekStart == currentStart.Date ? weekStart.AddDays(7) : weekStart;
           }

    Is there any way I can get around this?

    If I'm not using this custom tick provider, at least the first day is correct, but it still always add 7 days.

    Regards,
    Håkan
  14. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Mar 2012 Link to this post

    Hello Håkan,

    I am not sure I understand the requirement.  This is the expected behavior - the first day in TimelineView is the current date. And since VisibleDays is set to "14 days", the first and the last weeks are not complete.

    Can you please explain in more details and/or send us a screenshot showing the needed approach?

    Regards,
    Yana
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  15. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 09 Mar 2012 Link to this post

    Hi Yana!

    Yes, the first and last weeks are not complete, but as you can see in my attaced image,
    the group header is always displaying whole weeks (monday to sunday).

    I would like it to display:
    Thursday to sunday in the first week
    Monday to sunday in the second week
    Monday to wednesday in the third and last week

    The group header should display the actual days below it, not the whole week.
    Hope you understand my problem now...

    Regards,
    Håkan

  16. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 12 Mar 2012 Link to this post

    Hello Håkan,

    Thank you for sending the additional details.

    I've modified the project, so now the headers should be shown as expected. Please download the attachment and give it a try.

    Greetings,
    Yana
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  17. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 15 Mar 2012 Link to this post

    Thanks Yana!

    Now it works as expected.

    Regards,
    Håkan
Back to Top
DevCraft banner