This is a migrated thread and some comments may be shown as answers.

Changing Cursor on ZoomIn Scroll Enabled

1 Answer 80 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 27 Oct 2011, 01:36 PM
Is it possible to change the mouse cursor inside the ChartArea when zooming in scrolling is enabled?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 01 Nov 2011, 02:20 PM
Hi Jake,

When you have enabled zooming & scrolling on your chart area it automatically changes its cursor to Hand to hint the user he can zoom using the selection rectangle. You can disable this selection rectangle by finding the DragZoomLayerControl, responsible for zooming & scrolling functionality, and disable its interactivity like this:

void chartArea_Loaded(object sender, RoutedEventArgs e)
{
    var dragZoomLayer = chart1.ChildrenOfType<DragZoomLayerControl>().Single();
    dragZoomLayer.IsInteractive = false; // disable selection rectangle
}
The method ChildrenOfType is an extension method defined in the Telerik.Windows.Controls namespace so make sure you add a using statement.

You can also change the cursor of the series by specifying a new cursor in the Appearance property of the series definition like this:
<telerik:BarSeriesDefinition>
    <telerik:BarSeriesDefinition.Appearance>
        <telerik:SeriesAppearanceSettings Cursor="None" />
    </telerik:BarSeriesDefinition.Appearance>
</telerik:BarSeriesDefinition>

I have created a small sample application that demonstrates this approach. Please take a look at it and tell me how it is.

Best wishes,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Jake
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or