<
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
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
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.
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
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.
Miro Miroslavov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
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
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.
Miro Miroslavov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.