I am currently using a ChartView control (w/ChartPanAndZoomBehavior) and a Diagram control in my application. Apparently, the mechanism for panning is different between the two controls. In the ChartView, you have to right click and drag to pan, but for the Diagram, you have to ctrl + left click and drag. Going between these two mechanisms can be confusing. Is there any way to set the key combination for panning so that it could be consistent between the controls?
4 Answers, 1 is accepted
You are right that by default to start the panning operation in RadDiagram you need to hold down the Ctrl key and drag the viewport with the mouse.
However, you can activate the Pan MouseTool to start a pan operation simply by dragging the current viewport with the mouse (like in the RadChartView).
Please have in mind, that when the PanTool is active, the Pointer Tool and Connector Tool are disabled.
A sample implementation of this behavior you can see in our SDK example - Panning without using Ctrl.
I hope this information will help you.
Please accept my apologies for the confusion. If I've understood you right this time I can suggest the following:
- default behavior - PointerTool for the RadDiagram (just left-mouse)
- panning behavior - start panning with CTRL+ left mouse and dragging the current viewport for the both controls
To achieve this behavior we can set in the ChartPanAndZoomBehavior the DragMode property to None by default and only when the CTRL is pressed to set the DragMode to Pan. For your convenience I implemented this approach in the attached project. Please take a look at it and let me know if it works for you.
I looked at your solution and was able to get it to work (with ctrl + left click for chart view panning). I did modify it some bit. In order to still enable zooming, I set the DragMode property to "Zoom" and then for the OnKeyUpEvent:
Thanks for your help!