Timeline SelectionMode with custom templates

Chris

Is is possible to have fully customised templates that still supports the SelectionMode functionality?

I have a Timeline supporting Selection (SelectionMode="Extended") working as expected. However, as soon as I change the item template using TimelineItemTemplate to contain some custom content it no longer allows selections to be made.

E.g. using the Telerik demo code template from the CustomizingItems project shows the issue:

<DataTemplatex:Key="ItemWithDurationTemplate">

<BorderWidth="10"Height="10"...>

<RectangleHeight="7"Width="7"... >

</Rectangle>

</Border>

</DataTemplate>

...

<t:RadTimeline Grid.Row="0"

TimelineItemTemplate="{StaticResource ItemWithDurationTemplate}"

...

If I change the template to:

<DataTemplatex:Key="ItemWithDurationTemplate">

<t:TimelineItemControlx:Name="ItemLine"Height="10"... />

...

it again allows selection. It appears that the selection feature is provided by the Telerik control TimelineItemControl. However this doesn't allow content and so limits customisability.

The first one is to use implicit style instead of data template, the same as CustomTimelineItemControlStyle in the attached project, just remove the key.

If a data template is needed for your requirements, you can put a TimelineItemControl inside it and apply to it the needed custom style (with the visual states since they are needed to achieve a visual presentation of the selection).

A similar approach is used in our FirstLook demo (again the same is available for WPF).

Please let me know whether this helps.

Regards,
Sia
Telerik

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.