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

Maximum number of diagram connections

9 Answers 181 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rostislav
Top achievements
Rank 1
Rostislav asked on 29 Sep 2012, 01:33 PM
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!

9 Answers, 1 is accepted

Sort by
0
Accepted
Miro Miroslavov
Telerik team
answered on 03 Oct 2012, 06:45 AM
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.

0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 10:34 AM
It works, thank you very much!
0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 10:35 AM
It works, thank you very much!
0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 10:36 AM

It works, thank you very much!
0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 10:37 AM
It works, thank you very much!
0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 10:38 AM
Hello, 
it works, thank you very much for great support!

0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 10:40 AM
It works, thank you very much!
0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 11:24 AM
It works, thank you very much!
0
Rostislav
Top achievements
Rank 1
answered on 03 Oct 2012, 08:20 PM
It works, thank you!
Tags
Diagram
Asked by
Rostislav
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Rostislav
Top achievements
Rank 1
Share this question
or