Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Scheduler > How to change header of a day?

Answered How to change header of a day?

Feed from this thread
  • John avatar

    Posted on Dec 14, 2011 (permalink)

    I need to change header of day in this way, that if a date of a day is today, then I add Today to header, the same for yesterday and next day. If date is e.g. one week ago, then I don's need to add anything

    I couldn't find property to change that.

    I need the same efect as in an attachment, but "th" is not necessary

    Best regards
    Attached files

    Reply

  • Answer Dani Dani admin's avatar

    Posted on Dec 16, 2011 (permalink)

    Hello John,

    Supposedly you are referring to the TimelineViewDefinition. You need to use the TimeRulerItemTemplateSelector and customize its HorizontalTimelineGroupTemplate.

    Set the Binding to DateTime rather than FormattedValue and add a StringFormat specifier. Also, add an additional TextBlock to hold the words "Today", "Yesterday" or "Tomorrow" and bind it again to the DateTime property of the TimeRulerItem, but using a Converter to return the correct string.

    For example:

    <telerik:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding DateTime, Converter={StaticResource MyDateTimeToStringConverter}}" Margin="2 1"  />                       
                            <TextBlock Text="{Binding DateTime, StringFormat=dd MMMM}" Margin="2 1" TextAlignment="Left" />
                        </StackPanel>                   
                    </DataTemplate>
                </telerik:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>

    To make the day before today visible, you will also need to configure the VisibleRange of the view definition. Please, check this help article on the same topic.

    I hope this helps.

    Greetings,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • John avatar

    Posted on Jan 3, 2012 (permalink)

    Thanks

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Scheduler > How to change header of a day?
Related resources for "How to change header of a day?"

Silverlight Scheduler Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]