Scheduleview change view definitions time format programmatically

4 posts, 0 answers
  1. Shalin
    Shalin avatar
    9 posts
    Member since:
    May 2015

    Posted 27 Aug 2015 Link to this post

    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.

  2. Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 28 Aug 2015 Link to this post

    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
  3. DevCraft banner
  4. Shalin
    Shalin avatar
    9 posts
    Member since:
    May 2015

    Posted 31 Aug 2015 Link to this post

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

    Thanks

  5. Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 31 Aug 2015 Link to this post

    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
Back to Top