Display Time in Military Time

5 posts, 0 answers
  1. StevenDale
    StevenDale avatar
    100 posts
    Member since:
    Apr 2007

    Posted 05 Jun 2009 Link to this post

    Is it possible to show the times in the RadTimePicker in Military Time format?

    Thanks,

    Billy Jacobs
  2. StevenDale
    StevenDale avatar
    100 posts
    Member since:
    Apr 2007

    Posted 05 Jun 2009 Link to this post

    I see how to use military time now by setting the starttime and endtime to "0:0:0" and "23:0:0" but how do you set it back programatically?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 09 Jun 2009 Link to this post

    Hi Billy ,

    You can set the culture by changing the culture of the control. Use this code:
    timepicker1.Culture = new CultureInfo("en-gb"); 

    This will set the RadTimePicker to military time if you want AM/PM change culture to "en-us".

    Hope this helps.

    All the best,
    Boyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. StevenDale
    StevenDale avatar
    100 posts
    Member since:
    Apr 2007

    Posted 09 Jun 2009 Link to this post

    Is there a way to set it in a style based on the value of another control such as a checkbox.

    My problem is that my TimePicker is in a datatemplate and I can access is programatically. So if I could use Triggers to set the the Culture property based on whether a checkbox was checked or not would solve my problem.

    Thanks,

    Billy Jacobs
  6. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 11 Jun 2009 Link to this post

    Hello Billy Jacobs,

    You can do this by using triggers. The solution will be different depending on whether the Checkbox is in the template or not . You can take a look at this article that will give you an idea on how it can be done.
     
    If you need more help please let me know.

    Best wishes,
    Boyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for WPF is Visual Studio 2017 Ready