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

How to Prevent Scrolling the Parent ScrollViewer When Using the Zoom Functionality of RadCartesianChart.

Environment

Product Version 2024.2.514
Product RadChartView for WPF

Description

Prevent the parent ScrollViewer element from scrolling when using the zoom functionality of RadCartesianChart.

Solution

Subscribe to the MouseWheel event of the RadCartesianChart instance. In the event handler, set the e.Handled property to True.

Do not handle the PreviewMouseWheel event as it will disable the zoom functionality of the control.

Subscribing to the MouseWheel event and setting the e.Handled property to True

private void RadCartesianChart_MouseWheel(object sender, MouseWheelEventArgs e) 
{ 
    e.Handled = true; 
} 
In this article