GanttView OneHour major tick line display format - 12 vs 24h

2 posts, 0 answers
  1. Bartosz
    Bartosz avatar
    1 posts
    Member since:
    Jul 2015

    Posted 16 Nov Link to this post

    Hi,

    I'm using RadGanttView in my program with considerable success but there's one problem that I don't know how to solve.

     

    The view in my program will be displayed with different time scales (from minutes to hours per major tick) and with different CultureInfo for different clients.

    I observed that when I set a culture info that requires displaying hours in 24 hour format I get that format in the time ruler view when major tick lines are 15 minutes apart, but not when they are 1h apart. 

    I poked around the ganttView object itself and I found out that the are no tick lines defined in default version of ganttView in its publicly available property TimeRulerLines. But if I debug the object and reach into its private field of timeRulerDataSource there is a collection of intervals defined for TimeRulerLines of type MajorTickLines.

    ganttViewObject.timeRulerDataSource.TimeRulerSettings.TimeRulerLines[index for type (MajorTickLines)]

    In this collection I could see that the intervals of FifteenMinutes and less had FormatString defined with "HH" (24h format, as required by the specified culture info) but for OneHour and more the format string is null.

    How can I reliably adjust the OneHour tick interval format string in a way that would make no assumptions about the intervals defined by the user of my code and at the same time through some publicly available path of properties?

  2. Martin Vatev
    Admin
    Martin Vatev avatar
    133 posts

    Posted 21 Nov Link to this post

    Hello Bartosz,

    It seems that the desired behavior is not supported. We always appreciate customers feedback related to our components. For that reason, I have logged your suggestion as a feature request in our feedback portal. I would encourage you to vote and this will increase its priority when we consider our future development plans. You may track its progress following this link.

    I updated your Telerik points for bringing this to our attention. In the meanwhile you can set the FormatString of the MajorTickLine to the desired format, more details could be found in TimeRulerLines article. I created and attached a sample project for you that shows the described approach, hope this is helpful.

    Regards,
    Martin Vatev
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top