Scheduler days 2 digit size

2 posts, 0 answers
  1. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2012 Link to this post

    Hi,

    I want to change Scheduler days view from 3 digit to 2 digit.
    What should I do?
    Sample code is below.

     <telerik:RadScheduleView.ViewDefinitions>
        <telerik:TimelineViewDefinition VisibleDays="31" TimerulerGroupStringFormat="{}{0:dd ddd}"
           TimerulerMajorTickStringFormat="{}{0:%M}.{0:%d}"  LargeChangeInterval="15d" MajorTickLength="1d"
            MinorTickLength="1d" GroupTickLength="1d"/>
       </telerik:RadScheduleView.ViewDefinitions>

    Mehmet,
    Regards

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 02 Aug 2012 Link to this post

    Hello Mehmet,

    We are using the standard date and time format strings described in this article. Note that there is no format string for 2 digit days. Anyway, I can suggest you a different approach to achieve the requirement - you could set the TimeRulerItemTemplateSelector property of the ScheduleView and customize the needed text in the Group TimeRulerItem.  You should use HorizontalTimelineGroupTemplate property  - I would suggest to create a ValueConverter to convert the day name:


    <local:TimeRulerItemTemplateSelector x:Key="CustomTimeRulerItemTemplateSelector">
        ...
        <local:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding FormattedValue, Converter={StaticResource DayConverter}}" Margin="2 1" TextAlignment="Left" />
            </DataTemplate>
        </local:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
        ...
    </local:TimeRulerItemTemplateSelector>

    I've attached a simple example to demonstrate the approach. Hope this helps.

    Greetings,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top