New to Telerik UI for WPF? Download free 30-day trial

How to Display DataTable DataRow Information in TrackBallInfoTemplate

Environment

Product Version 2022.3.1109
Product RadChartView for WPF

Description

How to display DataTable DataRow information in the TrackBallInfoTemplate properties of the chart view series.

Solution

To display the values of the DataRow, you can use the DataItem property of the DataPoint instance. The DataPoint comes from the DataPointInfo object that is generated for each series entry. The DataItem will be of type DataRow and you can use the square brackets syntax to choose which values are going to be displayed.

Displaying DataTable DataRow information in TrackBallInfoTemplate

<telerik:PointSeries ItemsSource="{Binding DataTable.DefaultView}"> 
    <telerik:PointSeries.TrackBallInfoTemplate> 
        <DataTemplate> 
            <StackPanel Orientation="Horizontal"> 
                <TextBlock Text="Value is: "/> 
                <TextBlock Text="{Binding DataPoint.DataItem[MyDataRowValue]}" Foreground="red"/> 
            </StackPanel> 
        </DataTemplate> 
    </telerik:PointSeries.TrackBallInfoTemplate> 
</telerik:PointSeries> 
In this article