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

Timeline days seperation

1 Answer 89 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Jeffrey asked on 14 Jul 2011, 09:36 AM
Hello,

I'm using the timelineview and I want to make the difference between the days clear, I thought doing this by give the line between the days another color, but I don't know how to do that. I already tried to chance the VerticalLineStyle, but this chances the color of every line. Is there a way to do this for only the lines between the days? If not, is there another way to make the difference between each day clearer.

<SolidColorBrush x:Key="TimeRulerLineStroke" Color="#68C0ED" />
<Style x:Key="TimeRulerLineBaseStyle" TargetType="schedule:TimeRulerLine">
    <Setter Property="BorderBrush" Value="{StaticResource TimeRulerLineStroke}" />
</Style>

<schedule:OrientedTimeRulerItemStyleSelector.VerticalLineStyle>
    <Style TargetType="schedule:TimeRulerLine" BasedOn="{StaticResource TimeRulerLineBaseStyle}" />
</schedule:OrientedTimeRulerItemStyleSelector.VerticalLineStyle>

Best regards,

Jeffrey

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 15 Jul 2011, 02:34 PM
Hello Jeffrey,

The day headers in timeline view are part of the TimeRulerItemStyleSelector. So are the minor and major ticks. And so are the vertical lines. There are no borders corresponding only to the day headers, however.

To create vertical lines that can have a different brush for the days only, you need a custom TimeRulerItemStyleSelector.

In that selector you can get the datetime data that comes with each vertical line, and provide a custom style for the timeruler line when the line marks the start of a day - i.e. 12:00 AM.

Such a selector would look something like this:
public override Style SelectStyle(object item, DependencyObject container, ViewDefinitionBase activeViewDeifinition)
       {
           if (container is TimeRulerLine)
           {
               TickData tick = item as TickData;
               if (tick.DateTime == tick.DateTime.Date)
               {
                   return DayLineStyle;
               }
               return MinorTickLineStyle;
           }
           return base.SelectStyle(item, container, activeViewDeifinition);
       }

You will also need to customize the day headers themselves to match the style applied to the vertical lines. The style to do that is TimeRulerGroupItemStyle, which is a part of the TimeRulerItemStyleSelector.

Also check this online help article related to customizing the time ruler items.

I hope this helps.


Regards,
Dani
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ScheduleView
Asked by
Jeffrey
Top achievements
Rank 1
Answers by
Dani
Telerik team
Share this question
or