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

ScrollView Diagram

7 Answers 301 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 22 Mar 2012, 12:06 PM
Hello. I want scrolling my RadDiagram.
<ScrollViewer HorizontalScrollBarVisibility="Auto"  VerticalScrollBarVisibility="Auto">
         <telerik:RadDiagram IsZoomEnabled="False" AllowDrop="True" Name="radDiagram1"
                      SelectionChanged="radDiagram1_SelectionChanged" />
</ScrollViewer>

When I add some shape on diagram in runtime, scroll still not enable. Maybe I need do some refresh diagram? Help me, please.

7 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 27 Mar 2012, 02:04 PM
Hello Anton,

The RadDiagram cannot work with the ScrollViewer control at the moment. However, we've added this request to our to-do list and we will do our best to implement it for the official version of the framework coming out with the Q2 2012 release.

I also updated your Telerik account for your valuable feedback.

Kind regards,
Tina Stancheva
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
donovan
Top achievements
Rank 1
answered on 17 Jul 2012, 03:51 AM
Is there a scroll work around?
0
Miro Miroslavov
Telerik team
answered on 17 Jul 2012, 06:09 AM
Hi donovan,

 For the Q2 version of the RadDiagram, we've added build-in support for ScrollBars - you can easily enable them by setting the following attached properties to the Diagram:

ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"

Let us know if this is what you need.

All the best,
Miro Miroslavov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Gyula
Top achievements
Rank 1
answered on 17 Jul 2012, 09:38 AM
Hi,

Reading this thread helped me setting up a scrollable RadDiagram control, but I still have an issue.
I've added the shapes to the diagram in the window's constructor, and did something like this after it:

TreeLayoutSettings settings = new TreeLayoutSettings()
{
  TreeLayoutType = TreeLayoutType.TreeDown,
  VerticalDistance = 20,
};
settings.Roots.Add(diagramControl.Shapes[0]);
diagramControl.Layout(LayoutType.Tree, settings);

The layout is very nice, but since I have a lot of items on my diagram, and the diagram area is small, lots of shapes are out of the view. My issue is, that altough the scrollbars are visible, they aren't active/enabled at first load. After zooming, panning or any interaction with the diagram the scrollbars are activated and working as intended/expected. But I need to interact with the diagram to enable the scrollbars. (I also read this thread, as it seems similar to my problem.)

If I call the AutoFit() method after the Layout(), then the scrollbars are active, but my diagram is shrunk. Better, but not what I really wanted. (If your diagram is huge, then it won't be readable.)
(One more thing: if you call AutoFit() and the scrollbars are set to Visible, then the diagram fits it's content _exactly_ to it's size. Because of this, the scrollbars become active, but there is nothing to scroll.)

Maybe a measurement is missing in the Layout() call, if the diagram has visible scrollbars. Is there a method to call to activate the scrollbars after the Layout() call?

Thanks,
Gyula
0
Miro Miroslavov
Telerik team
answered on 19 Jul 2012, 07:24 AM
Hi Gyula,

The initial scroll bars that are not updated properly after loading is a know bug, that we'll fix very soon. You're right that it is timing issue and you can workaround for now for example by updating the Diagram size a little and bring it back after the diagram has been loaded. (The scroll bars get updated on SizeChanged of the diagram). Also you may update the RadDiagram.Position property to manually pan the diagram and bring it back again (with one pixel for example)
The issue is already scheduled and will be fixed very soon so you may wait for the fix in our upcoming internal build. 
Sorry for any incontinence. Please let us know if this is ok for you.

All the best,
Miro Miroslavov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Gyula
Top achievements
Rank 1
answered on 19 Jul 2012, 08:15 AM
Hi Miro,

The provided workarounds are good enough for me. The project where I would like to use the RadDiagram is still under development, and probably you will be out with the fix sooner, than it finishes.

(In the meantime I found out, that the AutoFit() can already work with a margin. My bad...)

Thank you for your prompt response,
Gyula
0
Miro Miroslavov
Telerik team
answered on 19 Jul 2012, 10:05 AM
Hello Gyula,

 The issue is already resolve and the fix will be included in the upcoming SP1 release.
Regarding the AutoFit, yes indeed, it has Margin that specifies the spacing around the best fit rectangle containing all the items. 

All the best,
Miro Miroslavov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
Anton
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
donovan
Top achievements
Rank 1
Miro Miroslavov
Telerik team
Gyula
Top achievements
Rank 1
Share this question
or