Exception when set UseGlidingConnector = false

3 posts, 0 answers
  1. Alexander
    Alexander avatar
    77 posts
    Member since:
    Apr 2013

    Posted 08 Sep 2014 Link to this post


    when you try to reset the UseGlidingConnector property with a connection attached, an exception is thrown.
    How can I (programmatically) find the corresponding connection, detach it from the gliding connector and attach it to a normal connector?
    And for Undo-Functionality: how can I re-attach it to the gliding connector when performing an undo?

  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1183 posts

    Posted 10 Sep 2014 Link to this post


    You can use the OutgoungLinks and the IncomingLinks collections of the RadDiagramShape control to traverse all the connections going in out and in of a shape. In order to reset the UseGlidingConnector property you will first need to detach all connections, force the shape to use default connectors (RadDiagramShape.UseDefaultConnectors = true) and reattach the connections.

    As for the undo action, it is not supported out of the box. This means that you will need to manually implement the command that will be executed on undo. In order to do so, you can take advantage of the UndoableDelegateCommand. You can use the following snippet to understand how you can use it.

    UndoableDelegateCommand myCommand = new UndoableDelegateCommand("Name Of My UndoRedo Command",
                                        c =>
                                            //Do Actions
                                        c =>
                                            //Undo Actions
    I hope that this will be helpful.

    Pavel R. Pavlov
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alexander
    Alexander avatar
    77 posts
    Member since:
    Apr 2013

    Posted 11 Sep 2014 in reply to Pavel R. Pavlov Link to this post

    Thanks for your answer. It was not as simple as expected as I also wanted to remove the default connectors. In this case, you have to perform all actions in a certain ordering, which cannot simply be reversed on undo...
    But finally, I can now toggle UseDefaultConnectors and undo it.

Back to Top