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

Ruler Scrolling with the RadDiagram

1 Answer 148 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Yogendra
Top achievements
Rank 1
Yogendra asked on 26 Sep 2013, 11:21 AM
Hi

I am working on the diagram control. I have added the RadDiagramRuler control to it. Both of 
these control are inside a scrollviewer.
Th problem with this approach is, when the scrollviewer is scrolled vertically the top ruler hides 
and when scrolled  horizontally the Left most ruler hides.
What I want is to let all the rulers, top left right and bottom displays otherwise the scroll. 
If I place the ruler outside of the scroll bar, the value to rulers don't updates on scrolling.

Please suggest something. Thanks.

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 01 Oct 2013, 07:28 AM
Hello,

The reported behavior is expected when you host both controls in a ScrollViewer component. You actually are scrolling both controls.

Please note that there is straightforward way to achieve your requirement. You can use attached properties to visualize scroll bars inside the RadDiagram.
Furthermore, the RadDiagramRuller component will properly handle the scrolling.

Please try using this snippet and let us know if it works in your particular scenario:

<Grid x:Name="LayoutRoot" Background="White">
    <Grid.RowDefinitions>
        <RowDefinition Height="20" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="20"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <telerik:RadDiagramRuler Diagram="{Binding ElementName=xDiagram}" Placement="Top" Grid.Column="1" />
    <telerik:RadDiagramRuler Diagram="{Binding ElementName=xDiagram}" Placement="Left" Grid.Row="1" />
    <telerik:RadDiagram x:Name="xDiagram"
                        Grid.Row="1"
                        Grid.Column="1"
                        ScrollViewer.HorizontalScrollBarVisibility="Visible"
                        ScrollViewer.VerticalScrollBarVisibility="Visible">
        <telerik:RadDiagramShape x:Name="shape1"
                                 Content="Shape 1"
                                 Position="20,20" />
        <telerik:RadDiagramShape x:Name="shape2"
                                 Content="Shape 2"
                                 Position="520,520" />
        <telerik:RadDiagramConnection Source="{Binding ElementName=shape1}" Target="{Binding ElementName=shape2}" />
    </telerik:RadDiagram>
</Grid>
I hope this clarifies your concerns.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Diagram
Asked by
Yogendra
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or