Schedule View TimerulerMajorTickStringFormat

3 posts, 0 answers
  1. Sebastiano
    Sebastiano avatar
    5 posts
    Member since:
    Oct 2010

    Posted 23 May 2011 Link to this post


    I'm looking for a way to display week numbers in this field. Is it possible to do this in the current control version?

  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 25 May 2011 Link to this post

    Hello Sebastiano,

    Unfortunately, displaying the week numbers in the TimeRuler is not possible, since they won't get update when the date range is changed. However, you can display them in the group headers of each view. Please find attache a sample project which illustrates this. The project is for Silverlight, however, the logic is the same. It contains also the full xaml of the ScheduleView, which will be of no use to you. Please verify that the templates used in MainPage.xaml are correct for WPF. For more information about customizing the Group Headers you can refer to this online demo.

    Hope this helps. Please let us know if you have further questions.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Maxime
    Maxime avatar
    1 posts
    Member since:
    Aug 2016

    Posted 19 Aug 2016 Link to this post

    I did some research on this issue and I kept finding this post over and over. Since I found a solution to display week in TimeRuler, I though it was a good idea to post it here.

    You can display weeks on TimeRuler using the ITickProvider on MajorTickLength or MinorTickLength property of the ViewDefinition.

    Here is a sample of the code I use for ITickProvider:

    using System;
    using Itenso.TimePeriod;
    using Telerik.Windows.Controls.ScheduleView;
    public class WeeklyTickProvider : ITickProvider
        public string GetFormatString(IFormatProvider formatInfo, string formatString, DateTime currentStart)
            Week week = new Week(currentStart);
            return currentStart.Date == week.FirstDayOfWeek
                ? string.Format("W{0}", week.WeekOfYear)
                : string.Empty;
        public DateTime GetNextStart(TimeSpan pixelLength, DateTime currentStart)
            return new Week(currentStart).LastDayOfWeek.AddDays(1);

    Here is the xaml:

        <t:TimelineViewDefinition VisibleDays="30"
                    <csv:MonthlyTickProvider />
                    <csv:WeeklyTickProvider />


    Hope this will help someone.

    PS: english is not my native language. Sorry if I made mistakes.

Back to Top