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

Scheduleview change view definitions time format programmatically

3 Answers 38 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Shalin
Top achievements
Rank 1
Shalin asked on 27 Aug 2015, 10:10 AM

Hi,

 I want to change RadScheduleView 's ViewDefinitions TimerulerMajorTickStringFormat to current thread culture time format string. i tried setting this in code behind and by using convertor, in both approach it gives exception "Input String is not in a correct format", but i used hard coded which works in xaml file.

  in xaml,

<telerik:DayViewDefinition
x:Name="DayViewDefination" TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}" />

below code snippet tried end of the view's constructor (after initializing component) and even before that, no luck

this.DayViewDefination.TimerulerMajorTickStringFormat = "{}{0:HH}:{0:mm}";
 

Could you please help me.

3 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 28 Aug 2015, 11:21 AM
Hello Shalin,

In order to set that desired format for the TimerulerMajorTickStringFormat you need to use the string value shown below:
this.dayViewDefinition.TimerulerMajorTickStringFormat = "{0:HH}:{0:mm}";

Hopes this helps.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Shalin
Top achievements
Rank 1
answered on 31 Aug 2015, 07:12 AM

This works perfectly on me. But please update your documentation, regarding "How to set View's time format string programatically" section. 

Thanks

0
Nasko
Telerik team
answered on 31 Aug 2015, 08:02 AM
Hi Shalin,

We are glad the proposed approach worked for you. Also, thank you for the feedback we will consider improving the article as soon as possible.

Meanwhile, if you have any additional questions or concerns regarding Telerik controls, please do not hesitate to contact us.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ScheduleView
Asked by
Shalin
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Shalin
Top achievements
Rank 1
Share this question
or