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

RadDiagramConnection Setting Start or End point does not redraw the connection

1 Answer 40 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 26 Nov 2013, 05:46 AM
Hi,

I seem to have come across an issue with setting the StartPoint and EndPoint properties of a RadDiagramConnection.  The connection is not redrawn.  Only when I move one of the end does it redraw properly.

It only happens when a StartPoint AND EndPoint is specified (ie not attached to any other shapes via the Source and Target properties).
So I cant programmatically move the connector at the moment which is an issue.  Can you help me please?


Here's a quick sample:

XAML:

<Grid>

<Grid.RowDefinitions>

<RowDefinition Height="*"/>

<RowDefinition Height="Auto"/>

</Grid.RowDefinitions>

<telerik:RadDiagram x:Name="_diagram" Grid.Row="0">

<telerik:RadDiagramConnection x:Name="_connector"

StrokeThickness="2"

StartPoint="100,100"

EndPoint="200,200" />

</telerik:RadDiagram>

<Button x:Name="_do"

Grid.Row="1"

Content="Move" Click="_do_Click" />

</Grid>


Code behind:
 
public partial class MainWindow : Window

{

public MainWindow()

{

InitializeComponent();

 

}

private void _do_Click(object sender, RoutedEventArgs e)

{

_connector.EndPoint = new Point(300, 300);

}

}


1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 28 Nov 2013, 12:31 PM
Hi Chris,

You are right for the behavior of the connection. In order to update the visual representation you need to invoke the Update() method of the connection after changing the EndPoint property. You can use the following snippet:

private void _do_Click(object sender, RoutedEventArgs e)
 
{
 
_connector.EndPoint = new Point(300, 300);
_connector.Update();
 
}
Please give this approach a try and let us know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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
Chris
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or