Maximum number of diagram connections

10 posts, 1 answers
  1. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 29 Sep 2012 Link to this post

    Hello, 
    i was wondering, if there is a simple way to set a maximum number of possible connections for diagram shape connector?
    Moreover Is there a way to check actual connections for particular connector?
    If there was i guess i could then check those and i could try not to allow user to create additional connection.
    Thank you!
  2. Answer
    Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 03 Oct 2012 Link to this post

    Hello Rostislav,

     There is no built-in way to restrict the number of connections per Connector, but you can easily achieve this. 
    You should handle the ConnectionManipulationStarted/Completed event and in the event arguments, you can check something like the following and mark the event as handled - this will prevent the user from creating the connection:

    if (diagram.GetOutgoingConnectionsForShape(e.Shape).Count(c => c.SourceConnectorResult == e.Connector) > 2)
                {
                    e.Handled = true;
                }

    Please let us know if this is working for you. 

    Regards,
    Miro Miroslavov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    It works, thank you very much!
  5. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    It works, thank you very much!
  6. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post


    It works, thank you very much!
  7. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    It works, thank you very much!
  8. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    Hello, 
    it works, thank you very much for great support!

  9. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    It works, thank you very much!
  10. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    It works, thank you very much!
  11. Rostislav
    Rostislav avatar
    9 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    It works, thank you!
Back to Top
DevCraft banner