RadContextMenu with Timeline

2 posts, 1 answers
  1. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 21 Dec 2012 Link to this post

    I've tried using a RadContextMenu with the RadTimeline, but it doesn't seem like I can get access to the clicked Timeline DataItem through either the Opened or Click events.  Is there another way I can access the item that was clicked on in these events?

    <telerik:RadTimeline x:Name="timelineControl"
                         PeriodStart="{Binding TimelinePeriodStart, Mode=TwoWay}"
                         PeriodEnd="{Binding TimelinePeriodEnd, Mode=TwoWay}"
                         ItemsSource="{Binding TimelineItems}"
                         ItemTemplateSelector="{StaticResource timelineTemplateSelector}"
                         VisiblePeriodStart="{Binding TimelineVisiblePeriodStart, Mode=TwoWay}"
                         VisiblePeriodEnd="{Binding TimelineVisiblePeriodEnd, Mode=TwoWay}">
            <telerik:RadContextMenu x:Name="TimelineContextMenu" Opened="TimelineContextMenu_OnOpened">
                <telerik:RadMenuItem Click="RadMenuItem_OnClick">
                        <TextBlock FontSize="14">Remove from Timeline</TextBlock>
  2. Answer
    Tsvetie avatar
    1517 posts

    Posted 27 Dec 2012 Link to this post

    Hello Josh,

    In this case, you can use the GetClickedElement method of RadContextMenu to get the timeline item that was clicked. For example:

    TimelineItemControlBase timelineItem = radContextMenu.GetClickedElement<TimelineItemControlBase>();

    For additional information, please refer to our online documentation and online demos.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top