LineSeries PointTemplate Issue

2 posts, 1 answers
  1. Lampros
    Lampros avatar
    5 posts
    Member since:
    Jan 2013

    Posted 22 Mar 2014 Link to this post


    I'm trying to create a custom LineSeries.PointTemplate in a ChartView control using the following xaml:

    ​ <telerik:LineSeries Name="lineSeries" ItemsSource="{Binding}" ValueBinding="Availability" CategoryBinding="ReportDate">
    <Button Width="10" Height="10" ToolTipService.ToolTip="Show Report for this month..." Click="Button_Click"/>

    and I have the following problems:
    - The button defined in the template is displayed correctly, but is inactive/disabled.
    - How can I set the content of the button via a binding property of the Chart's DataContext or the label value of the point?


  2. Answer
    Martin Ivanov
    Martin Ivanov avatar
    1451 posts

    Posted 26 Mar 2014 Link to this post

    Hello Stergios,

    In order to interact with the buttons in your PointTemplate you can set the IsHitTestVisible property of your LineSeries to True. Note that hit testing is the mechanism by which the Silverlight process input. You can read more about it in the Hit Testing and Input Events MSDN article.

    As for your second requirement you can use the DataItem property to access the business object that represents the data associated with a DataPoint.
            <Button Width="20" VerticalContentAlignment="Top" 
                    Content="{Binding DataItem.YValue}"
                    ToolTipService.ToolTip="Show Report for this month..."

    You can also take a look at the selection behavior of the chart view.


    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

Back to Top