Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Week numbers as Timeline column headers
posted

Is there a way to display week numbers in the timeline column headers when having a week interval?

Parents
No Data
Reply
  • 53790
    Suggested Answer
    posted

    Hello Amlim,

    Maybe one possible approach could be if you are using the property HeadTextFormat. In my sample I add additional interval - Week,  with StartRange property - StartDate and following code:

    private void ultraTimelineView1_VisibleDateTimeRangeChanged(object sender, VisibleDateTimeRangeChangedEventArgs e)

    {

        CultureInfo info = new CultureInfo("en-US");

        Calendar cal = info.Calendar;

     

        CalendarWeekRule myCWR = info.DateTimeFormat.CalendarWeekRule;

        System.DayOfWeek myFirstDOW = info.DateTimeFormat.FirstDayOfWeek;

     

        string weekString = "Week: " + cal.GetWeekOfYear(e.VisibleDateTimeRange.StartDateTime, myCWR, myFirstDOW);

        ultraTimelineView1.AdditionalIntervals[0].HeaderTextFormat = weekString;

    }

    Please let me know if you have any questions

Children