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

connector tool behaviour

1 Answer 82 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Revathi
Top achievements
Rank 1
Revathi asked on 17 Jun 2013, 08:40 AM
Hi,

I am exploring RadDiagram for silver light (using trial version now). Using raddiagram demo site (http://demos.telerik.com/silverlight/#Diagrams/FirstLook) I draw  process step 1, step 2 and step 3 (rectangle) shapes and connect them using straight line connector. Now I draw process step 4 shape straight down to step 1 and connect step 3 and step 4. The line comes diagonal. If I select connector style type as "poly line",  I am not getting a poly line connector. I have to select connector style type bezier and then switch back to poly line to get poly line behaviour on the drawing pane. My questions are
1) why direct selection of polyline style doesnot reflect polyline behaviour on the drawing pane?
2) I expect poly line to be displayed using straight lines as in the expected_behavior.jpg, but poly line displayed as shown in current_behavior.jpg. please tell me how to get the expected behavior?
3) if I select connector tool from the tools box, even after drawing the connector line, it keeps on drawing the connector lines whenever i click on the drawing pane till I select pointer tool. Is there any way to stop the connector lines from drawing after drawing the first connector line?

Immediate response would help me a lot
Thanks
Revathi

1 Answer, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 18 Jun 2013, 04:21 PM
Hi Revathi,
I'll try to answer all of you questions here:
1) By default the connections' type is Polyline, but they have just two points - Start and End. When you select Bezier type we automatically add two more points and that's why you see them when you go back to Polyline type. You could manually add connection points to a polyline connection by clicking on it while holding Ctrl key.
2) You'll either have to manually do this or use routing to get this type of display - could you please take a look at this article and try out the InflatedRectRouter routing (note: we're still working on the routing and we'll try to fix its issues for our next Q)
3) You could handle the ConnectiomManipulationCompleted event and change the tool there:
private void OnConnectionManipulationCompleted(object sender, Telerik.Windows.Controls.Diagrams.ManipulationRoutedEventArgs e)
{
    if (this.diagram.ActiveTool == MouseTool.ConnectorTool)
    {
        this.diagram.ActiveTool = MouseTool.PointerTool;
    }
}
or the ItemsChanged event:
private void OnDiagramItemsChanged(object sender, Telerik.Windows.Controls.Diagrams.DiagramItemsChangedEventArgs e)
{
    if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
    {
        if (e.NewItems.Count() > 0 && this.diagram.ContainerGenerator.ContainerFromItem(e.NewItems.ElementAt(0)) is IConnection)
        {
            this.diagram.ActiveTool = MouseTool.PointerTool;
        }
    }
}
I hope I was able to help you and if you have further questions please feel free to ask.

Regards,
Zarko
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
Revathi
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or