TrackBallInfoStyle button click

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    15 posts
    Member since:
    Feb 2014

    Posted 22 Apr 2014 Link to this post

    I want to add a button into the trackball information that is displayed.  I can add a button and it displays but the MouseLeftButtonUp never fires.  Also, in the code behind I cannot access "btnDD" in the example below.  

                    <telerik:ChartTrackBallBehavior ShowTrackInfo="True"

                    <Style TargetType="telerik:TrackBallInfoControl">
                        <Setter Property="HeaderTemplate">
                                    <TextBlock Text="{Binding}" 
                                    <Button x:Name="btnDD" MouseLeftButtonUp="btnDD_MouseLeftButtonUp">View Files</Button>
  2. Petar Marchev
    Petar Marchev avatar
    968 posts

    Posted 23 Apr 2014 Link to this post

    Hello Kevin,

    You cannot access the btnDD because it is defined in a DataTemplate and the framework does not allow you to access this element because you might use the template in many places and you will have many btnDD buttons.

    By default the track ball info control has its IsHitTestVisible property set to false. This is to prevent the track ball from hiding when the mouse is over it. If the hit test property is set to true, the track info control will swallow the mouse events and this will trigger the mouse leave event of the plot area, which in turn will hide the track ball, so you will not be able to click the button.

    Perhaps you can remove the track ball behavior and use annotations instead. Check out our track-ball-like-annotations sdk example. You may want to use the sdk browser for easier browsing. The example demonstrates how you can use annotations to mimic a track-ball-like feature. You can then update this example and place a button which you can click. I hope this helps.

    Petar Marchev
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft R3 2016 release webinar banner
Back to Top