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

Weeknumber TimerulerMajorTick

5 Answers 105 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Benny
Top achievements
Rank 1
Benny asked on 04 Apr 2011, 10:38 AM
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;
      }

5 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 07 Apr 2011, 09:43 AM
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
0
Stefan
Top achievements
Rank 1
answered on 03 Jan 2012, 03:21 PM
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
0
Yana
Telerik team
answered on 06 Jan 2012, 02:22 PM
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 >>

0
Tim
Top achievements
Rank 1
answered on 09 Jan 2012, 05:12 PM
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
0
Tim
Top achievements
Rank 1
answered on 10 Jan 2012, 10:24 AM
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
Tags
ScheduleView
Asked by
Benny
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Stefan
Top achievements
Rank 1
Yana
Telerik team
Tim
Top achievements
Rank 1
Share this question
or