This is a migrated thread and some comments may be shown as answers.

DisplayValueFormat exception error

4 Answers 35 Views
TimeSpanPicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steven
Top achievements
Rank 1
Steven asked on 17 Dec 2012, 07:52 AM

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

4 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 17 Dec 2012, 10:25 AM
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.
0
Steven
Top achievements
Rank 1
answered on 18 Dec 2012, 06:49 AM
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
0
Steven
Top achievements
Rank 1
answered on 18 Dec 2012, 06:55 AM
Sorry for last post I worked it out.

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

colon needs to be in quotes.

Regards
Steven
0
Deyan
Telerik team
answered on 18 Dec 2012, 02:08 PM
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.
Tags
TimeSpanPicker
Asked by
Steven
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Steven
Top achievements
Rank 1
Share this question
or