RTP as timespan selector

6 posts, 0 answers
  1. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 27 Jul 2012 Link to this post

    Am I aiming for the wrong thing to think I can use the RadTimePicker to select a Timepsan?

    I need get rid of the AM PM and also stop it from thinking/displaying 00:00:00 as 12:00PM?

    ohhh and what exactly am i binding to? SelectedTime={binding TimeSpan}?

    thanks in advance

    Michael
  2. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 29 Jul 2012 Link to this post

    just a kick

    telerik are usually so helpful in these matters
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 01 Aug 2012 Link to this post

    Hi Michael,

    In order to achieve this using the RadTimePicker you will have to set its Culture property. Also you will have to use the SelectedTime property to get the TimeSpan value of the RadTimePicker. Here is sample code: 
    public MainWindow()
    {
        InitializeComponent();
        var culture = new CultureInfo("en-US");
        culture.DateTimeFormat.ShortTimePattern = "HH:mm";
        this.RadTimePicker.Culture = culture;
    }


    All the best,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 01 Aug 2012 Link to this post

    thanks for the reply.

    The timepicker in my solution is within a DataFormDataField??

    So it cant be addressed like this.RadTimePicker?
  6. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 03 Aug 2012 Link to this post

    Hi Michael,

    If you don't have any other controls using the ShortTimePattern into your DataForm I would suggest you to change its Culture property. Otherwise you will have to iterate through the VisualTree to find the RadTimePicker control and set its culture.

    Regards,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 03 Aug 2012 Link to this post

    Nice thanks...I created a property on the viewmodel and bound the culture to that
Back to Top
UI for WPF is Visual Studio 2017 Ready