Weeknumber TimerulerMajorTick

6 posts, 0 answers
  1. Benny
    Benny avatar
    5 posts
    Member since:
    Sep 2012

    Posted 04 Apr 2011 Link to this post

    Is there any way to get the SchedelureView to show the weeknumber in TimeRulerMajorTick.

    FixedTickLengthProvider sevenDays = new FixedTickLengthProvider();
               sevenDays.TickLength = new TimeSpan(7, 0, 0, 0, 0); 
     
               SchProjekt.ViewDefinitions.Add(new TimelineViewDefinition()
               {
                   MajorTickLength = sevenDays,
                   Orientation = Orientation.Horizontal,
                   StretchGroupHeaders = true,
                   VisibleDays = 365,
                   Title = "Projekt",
                   TimerulerGroupStringFormat = "{0:MMM - yyyy}",
                   TimerulerMajorTickStringFormat = "{0:ddd}",
                   MinTimeRulerExtent = 1600,
                   MaxTimeRulerExtent = 1600
               });

    This shows the day of week, but i need to show the week number... 

    public static int GetWeekNumber(this DateTime date)
          {
              CultureInfo ci = CultureInfo.CurrentCulture;
              int wNr = ci.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
              return wNr;
          }
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 07 Apr 2011 Link to this post

    Hi Benny,

    Thank you for contacting us.

    Unfortunately, showing the week number into the TimeRuler is not possible, as this String format is not supported by the .NET platform. Please refer to this article for more information about the supported formats.

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

    Greetings,
    Konstantina
    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. DevCraft banner
  4. Stefan
    Stefan avatar
    1 posts
    Member since:
    Jun 2011

    Posted 03 Jan 2012 Link to this post

    Hi,

    we need this feature, too. Are there any plans to support this in the future. I understand that the group header formating concept is based on the .NET formating mechanism, but showing the week numbers in the calendar is quite a common request.

    Best regards,
    Stefan
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 06 Jan 2012 Link to this post

    Hello Stefan,

    Please find attached a simple example which demonstrates how you can show week numbers in the TimeRuler. Download the project and give it a try.

    Greetings,
    Yana
    the Telerik team

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

  6. Ivo
    Ivo avatar
    38 posts
    Member since:
    Jul 2011

    Posted 09 Jan 2012 Link to this post

    Hi Yana,

    thanks for the sample project. This is almost what I needed. From what I can see in this code is that it works only if the first day which is shown in the ScheduleView must be Monday, but what if the user decided to selects different day (Sunday, Friday,...)?
    In this case ScheduleView would group the days incorrectly (not from monday - Sunday). Is there any chance to display week correctly in this scenario?

    Best regards, Stefan
  7. Ivo
    Ivo avatar
    38 posts
    Member since:
    Jul 2011

    Posted 10 Jan 2012 Link to this post

    Hi Yana,

    I found the answer to my question here:
    http://www.telerik.com/community/forums/silverlight/scheduleview/month-and-week-columns-in-timeline-view.aspx

    I wrote my own TickPrivider in order to format the grouping header correctly. Thanks a lot!

    Best regards, Stefan
Back to Top
DevCraft banner