ScrollView Diagram

8 posts, 0 answers
  1. Anton
    Anton avatar
    5 posts
    Member since:
    Feb 2012

    Posted 22 Mar 2012 Link to this post

    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.
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 27 Mar 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. donovan
    donovan avatar
    13 posts
    Member since:
    Oct 2011

    Posted 16 Jul 2012 Link to this post

    Is there a scroll work around?
  5. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 17 Jul 2012 Link to this post

    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.

  6. Gyula
    Gyula avatar
    9 posts
    Member since:
    May 2012

    Posted 17 Jul 2012 Link to this post

    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
  7. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 19 Jul 2012 Link to this post

    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.

  8. Gyula
    Gyula avatar
    9 posts
    Member since:
    May 2012

    Posted 19 Jul 2012 Link to this post

    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
  9. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 19 Jul 2012 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready