New to Telerik UI for WPFStart a free 30-day trial

Display Trackball Info on Right Mouse Click

Updated on Sep 15, 2025

Environment

Product Version2019.2 624
ProductRadChartView for WPF

Description

How to display the ChartView trackball on right mouse button click.

Solution

Subscribe to the PositionChanging event of the ChartTrackBallBehavior and reset the last position if the mouse right button wasn't not clicked. Then subscribe to the MouseRightButtonDown event of RadCartesianChart and set the Position property of the behavior manually.

XAML
	<telerik:RadCartesianChart.Behaviors>
		<telerik:ChartTrackBallBehavior PositionChanging="ChartTrackBallBehavior_PositionChanging" x:Name="trackballBehavior" />
	</telerik:RadCartesianChart.Behaviors>
C#
	public partial class MainWindow : Window
    {
        private bool isManualPositionChange = false;
 
        public MainWindow()
        {
            InitializeComponent();
            this.trackballBehavior.Position = new Point(100, 321);
        }
 
        private void ChartTrackBallBehavior_PositionChanging(object sender, Telerik.Windows.Controls.ChartView.TrackBallPositionChangingEventArgs e)
        {
            if (e.NewPosition != e.PreviousPosition && !isManualPositionChange)
            {
                e.NewPosition = e.PreviousPosition;
            }           
            this.isManualPositionChange = false;
        }
 
        private void RadCartesianChart_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            isManualPositionChange = true;
            this.trackballBehavior.Position = e.GetPosition(this.chart);
        }
    }
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support