DisplayValueFormat exception error

5 posts, 0 answers
  1. Steven
    Steven avatar
    3 posts
    Member since:
    Dec 2012

    Posted 17 Dec 2012 Link to this post

    Hi

    I need details on how to set the DisplayValueFormat in RadTimeSpanPicker programmatically. Keeps giving me a format error with all my attempts to blindly work out the format structure.

    Require “h:mm” but gives me a format exception error.

    Kind regards

    Steven Baker

  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 17 Dec 2012 Link to this post

    Hello Steven,

    RadTimeSpanPicker internally uses the TimeSpan.ToString() method to format the value string. You can take a look at MSDN for details on what format strings are supported.

    As for your particular case: try using "h\:mm" and let me know if it works.

    Thanks for your time.

    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Steven
    Steven avatar
    3 posts
    Member since:
    Dec 2012

    Posted 18 Dec 2012 Link to this post

    Hi Deyan

    RadTimeSpanPicker breaktime = new RadTimeSpanPicker();

    breaktime.DisplayValueFormat = "h\:mm";

     

    This gives me the pre compile error "Unrecognized escape sequence" highlighting the colon.

    Maybe your example below refers to a Xaml example but not the same in code.

    regards
    Steven
  5. Steven
    Steven avatar
    3 posts
    Member since:
    Dec 2012

    Posted 18 Dec 2012 Link to this post

    Sorry for last post I worked it out.

    breaktime.DisplayValueFormat = "h':'mm";

    colon needs to be in quotes.

    Regards
    Steven
  6. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 18 Dec 2012 Link to this post

    Hi Steven,

    Thanks for writing back.

    We will consider this thread closed for now.

    Do not hesitate to right us back in case you need further assistance.

    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner