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

Panning

7 Answers 314 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 04 Apr 2012, 09:03 AM
Hey,

I'm using the Diagrams Framework in a project. I thought it would be nice to have a way of panning without the need of zoom. In your demos the IsPanEnabled is set but there is no way to pan around. I known that if you zoom the position of your cursor is used to pan but having some kind of hand-cursor to move the whole diagram around would be a pleasure. Have I missed a possibility to achieve this in the current version or are there any plans to include such a thing in a future version?

Best Regards,
Peter Schmidt

7 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 04 Apr 2012, 09:11 AM
Hi Peter,

 By the default, the Panning feature is turned on. You can disable this functionality by setting the RadDiagram.IsPanEnabled property to False. Once the panning is enabled, you can press Ctrl + MouseLeftButton and start panning the RadDiagram. Read the help here.
You can also change the current mouse tool to hand (pan) tool easily - read more
Please let us know if you have further questions. 

All the best,
Miro Miroslavov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Peter
Top achievements
Rank 1
answered on 04 Apr 2012, 09:36 AM
Hi Miro,

thanks! I did not know that. The shortcut is not standard so I did not try this combination. There is still a problem with this but therefore I need to describe the scenario:

I am using Image Elements in Diagram to display a zooming background. So a great portion of the canvas is filled with DiagramShapes. The panning tool is only working on areas without any shapes underneath it. For an editing scenario this makes perfect sense. But I am using Diagram to display plans and the whole control is readonly. So it would be great if I could pan while hovering over shapes, too.

Kind Regards,
Peter Schmidt
0
Miro Miroslavov
Telerik team
answered on 04 Apr 2012, 01:56 PM
Hi Peter,

 If your shapes are 100% readonly, you can set the IsEnabled prop. to False, which will prevent the Hit Test service and so the panning will work everywhere. 
Also note that you can change the short keys for the panning (if CTRL is not ok for you). 
On a side note, we're considering to implement Scrolling option - you can vote and check the backlog item here.

All the best,
Miro Miroslavov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Vicki
Top achievements
Rank 1
answered on 12 Apr 2017, 07:26 PM

Hi,  How to change the default Ctrl+MouseLeftButton panning to just Mouse Left button down and drag?

Thanks,

0
Petar Mladenov
Telerik team
answered on 13 Apr 2017, 03:29 PM
Hi Lupe,

This will happen if you set ActiveTool property to PanTool. Is this an option or you need a mixed mode - clicking on shape to move the shape, clicking on empty space on diagram to start pan tool ?

Regards,
Petar Mladenov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Vicki
Top achievements
Rank 1
answered on 17 Apr 2017, 06:12 PM

Hi Petar,

Looking for the mixed mode. is there a way to set it?

Thanks.

0
Petar Mladenov
Telerik team
answered on 18 Apr 2017, 10:43 AM
Hello Lupe,

You can develop custom Pointer Tool class which extends the one that is built-in and default in RadDiagram. Please find a sample code below:

public class CustomPointerTool : PointerTool
   {
       public override bool MouseDown(PointerArgs e)
       {
           bool result = base.MouseDown(e);
 
           if (this.HitItem == null)
           {
               this.ToolService.ActivateTool(PanningTool.ToolName);
               return false;
           }
 
           return result;
 
       }
 
       public override bool MouseUp(PointerArgs e)
       {
           bool result = base.MouseUp(e);
 
           if ((this.Graph as RadDiagram).ActiveTool == MouseTool.PanTool)
           {
               (this.Graph as RadDiagram).ActiveTool = MouseTool.PointerTool;
           }
 
           return result;
       }
   }
public Example()
      {
          InitializeComponent();
          ToolService toolService = this.xDiagram.ServiceLocator.GetService<IToolService>() as ToolService;
          if (toolService != null)
          {
              toolService.ToolList[0] = new CustomPointerTool();

For more information regarding tools customization in RadDiagram you can take a look at:

Diagram Tools Customization
Diagram Custom Tools SDK
Diagram Custom Connector Tools SDK

Regards,
Petar Mladenov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
Peter
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Peter
Top achievements
Rank 1
Vicki
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or