Panning inconsistent between Diagram and ChartView

5 posts, 0 answers
  1. Vivek
    Vivek avatar
    7 posts
    Member since:
    Apr 2013

    Posted 24 Feb 2014 Link to this post

    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!
  2. Milena
    Admin
    Milena avatar
    201 posts

    Posted 27 Feb 2014 Link to this post

    Hi Vivek,

    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 w
    hen 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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anthony
    Anthony avatar
    3 posts
    Member since:
    Jan 2013

    Posted 27 Feb 2014 in reply to Milena Link to this post

    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.
  5. Milena
    Admin
    Milena avatar
    201 posts

    Posted 28 Feb 2014 Link to this post

    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
  6. Vivek
    Vivek avatar
    7 posts
    Member since:
    Apr 2013

    Posted 04 Mar 2014 in reply to Milena Link to this post

    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:

    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!
Back to Top
UI for WPF is Visual Studio 2017 Ready