My use case is the display of a hierarchical tree of data (eg like an Org Chart), which needs to remain statically positioned and not allow user modifications. Is there a property(s) that can be set to disallow things like moving and editing actions across the whole diagram? Or is the solution to intercept individual events?
In essence, I only want users to be able to select nodes (because I will be display an additional property box when a node is selected), but not select, move, edit labels of, or delete connectors nor move, delete or resize nodes.
Hello James,
Just checking in, did you have any other questions or concerns on this matter?
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
I don't believe the XamOrgChart connections can have labels without having to write a new template for the connections. I have created a simple sample for you for the XamDiagram. This sample is attached.
To disallow everything except selection, I would recommend creating an EditTemplate for your nodes and connections, and placing something that is not editable in that template. This can be done through a style for DiagramNode and DiagramConnection and then setting it to the NodeStyle and ConnectionStyle of your node definitions if you are using them.
To disallow movement and deletion of nodes and connections, but still allow selection of them, I believe your best bet would be to handle the XamDiagram's NodeMoving, ConnectionMoving, and ItemRemoving events. Each of these are cancellable, so you can set e.Cancel = true in each.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewDeveloper Support Engineer IInfragistics Inc.www.infragistics.com/support
I briefly looked at it. My exact use case is a decision tree with Yes/No branches, and I need to label the connection lines with Yes/No. I could not find that functionality mentioned in the xamOrgChart documentation. Can connectors have labels in xamOrgChart?
Thank you for your post.
Have you considered using our XamOrgChart control to achieve this functionality? I believe that all of the functionality you have requested above is available out of the box with the XamOrgChart. Here is a link to our documentation about that control: http://help.infragistics.com/doc/WPF/2014.2/CLR4.0/?page=xamOrgChart.html.