Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.36 KB

kb-chartview-mousewheel-scrollviewer.md

File metadata and controls

43 lines (35 loc) · 1.36 KB
title description page_title type slug position tags res_type
How to Prevent Scrolling the Parent ScrollViewer When Using the Zoom Functionality of RadCartesianChart.
This article shows how you can prevent the parent ScrollViewer from scrolling when zooming in/out on/of RadCartesianChart.
Handle Scrolling of the Parent ScrollViewer When Zooming In and Out of the RadCartesianChart.
how-to
kb-chartview-mousewheel-scrollviewer
0
wpf, chartview, cartesianchart, chart, scroll, mouse wheel, wheel, zoom, zooming
kb

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.

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

[C#] Subscribing to the MouseWheel event and setting the e.Handled property to True

{{region kb-chartview-mousewheel-scrollviewer-0}} private void RadCartesianChart_MouseWheel(object sender, MouseWheelEventArgs e) { e.Handled = true; } {{endregion}}