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

Overlapping Timeline Items and ZIndex

1 Answer 96 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
Josh Eastburn
Top achievements
Rank 1
Josh Eastburn asked on 11 Jan 2013, 03:22 PM
There is an existing thread here that talks about Timeline items overlapping when zoomed out.
In my scenario, I am using icons/images to represent items on the timeline and even at the most zoomed-in level, there is some overlap.  It seems like items are layered based on the StartTime of the items, but is there a way to get the ZIndex set in the ItemTemplate to take priority for ordering?
I would like certain types of data to always show at the top, but this doesn't currently work even if the ZIndex is set higher than an item that starts immediately after it.

Thanks,
Josh

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 16 Jan 2013, 12:23 PM
Hi Josh,

Indeed, the task is not as trivial as you would expect. The reason for that is because you have to apply the custom ZIndex to the ContentPresenter that wraps your custom icons/images. You can use the following approach in order to do this:
  1. Add a property in your model MyZIndex that will contain the ZIndex for the timeline item.
  2. Apply it to the ContentPresenters, wrapping the timeline items, using the following implicit style: 
    <Style TargetType="ContentPresenter">
        <Setter Property="Canvas.ZIndex" Value="{Binding DataItem.MyZIndex}" />
    </Style>

Regards,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TimeLine
Asked by
Josh Eastburn
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or