ViewDefinitions CurrentCulture with 24h

3 posts, 0 answers
  1. David
    David avatar
    4 posts
    Member since:
    May 2012

    Posted 17 Jul 2012 Link to this post


    I use the RadScheduleView from RadControls for WPF Q2 2012
    If I do not define a TimerulerMajorTickStringFormat for a ViewDefinition I whould expect that the ShortTime Format of the  CurrentCulture is used to generate the time label. But If I use a current culture with a 24h display like german it only shows 12h.

    See attachment.

    It looks like a bug to me since it makes not much sense to show only 12h but no AM/PM like you can see on my screenshot.

    To work around this I have Bind the StringFormat to a property that returns this:
    Return "{0:" + CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern + "}"

    best regards,
  2. David
    David avatar
    4 posts
    Member since:
    May 2012

    Posted 18 Jul 2012 Link to this post

    I have improved it a bit by just writing TimerulerMajorTickStringFormat="{}{0:t}"
  3. Vladi
    Vladi avatar
    749 posts

    Posted 19 Jul 2012 Link to this post

    Hello David,

    RadScheduleView sets its culture corresponding to the current culture but in cases like this the appropriate way to set the culture is by using the TimerulerMajorTickStringFormat property. Setting the TimeRuler culture to 24 h is considered a breaking change and it is not in consideration.

    We apologize for any inconvenience that this may cause you.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top