RadDiagramConnection Setting Start or End point does not redraw the connection

2 posts, 0 answers
  1. Chris
    Chris avatar
    10 posts
    Member since:
    Aug 2010

    Posted 25 Nov 2013 Link to this post

    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);

    }

    }


  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 28 Nov 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top