Hi,
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?
Thanks!
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?
Thanks!
4 Answers, 1 is accepted
0
Hi Vivek,
I hope this information will help you.
Regards,
Milena
Telerik
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.
Regards,
Milena
Telerik
0
Anthony
Top achievements
Rank 1
answered on 28 Feb 2014, 12:04 AM
Unfortunately, this is still not an appropriate resolution to the original problem, which is the mechanism for panning is different between the two controls. Your suggestion is not a resolution to the problem or even a workaround because it's not much different than the existing setup. Existing setup = PointerTool is default with just left-mouse, Panning with CTRL+left mouse drag; Proposed setup = Panning is default with just left-mouse, PointerTool with SHFT+left mouse drag. All while ChartView is still right-click and drag. All that is happening in your suggestion is switching CTRL for SHFT. Our users need PointerTool AND Panning, and how they should do it is different between the two controls. What would be intuitive to any user would be the default should remain PointerTool, and drag should be consistent between Diagram and ChartView. Hope this makes sense. Thank you.
0
Hi Anthony,
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.
Regards,
Milena
Telerik
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.
Regards,
Milena
Telerik
0
Vivek
Top achievements
Rank 1
answered on 04 Mar 2014, 08:29 PM
Hi Milena,
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!
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:
private
void
OnKeyUpEvent(
object
sender, RoutedEventArgs e)
{
if
(Keyboard.PrimaryDevice.IsKeyUp(Key.LeftCtrl) && Keyboard.PrimaryDevice.IsKeyUp(Key.RightCtrl))
{
panzoomBehav.DragMode = ChartDragMode.Zoom;
this
.Cursor = Cursors.Arrow;
}
}
Thanks for your help!