Hello Community!
I create a hierarchical network of "Energy nodes". Each node can have multiple other energy nodes or multiple positions as childs. A position can not have any other childs.My problem is which TargetTypeName do I have to declare to visualize the nodes.
Attached please find the sample application. In the main windows two charts are shown with differnt NodeLayouts. I want to use the PosIdx property for the DisplayMemberPath for the PosConfigObject. The used UidStar for the EnergyBaseNode is functioning already. Can someone help me to configure the node settings for the position object?
Thank you
Hello grubarec,
In your second chart, you are missing a NodeLayout for the IBaseConfigObject. In your EnergyBaseNode class, you have a List<T> of IBaseConfigObjects so you need a NodeLayout attached to these, like you have in your first chart. After you create this NodeLayout, you can create another NodeLayout for the PosConfigObject.
<ig:OrgChartNodeLayout DisplayMemberPath="UIDStar" TargetTypeName="EnergyBaseNode" /> <ig:OrgChartNodeLayout DisplayMemberPath="ModuleNr" TargetTypeName="IBaseConfigObject" /> <ig:OrgChartNodeLayout DisplayMemberPath="PosIdx" TargetTypeName="PosConfigObject" />
I've reattached your sample with the changes I've made. Let me know if you have any questions on this.
Hello Rob!
Thanks for the hint!Can you tell me why I have to declare the exact type "PosConfigObject" and the "IBaseConfigObject" although I only want to display the PosConfigObject?Why are the EnergyNodes of the root element not rendered if I do not declare the IBaseConfigObject in the second chart?
Why are my EnergyNodes and the class name of my PosConfigObjects shown if I declare the IBaseConfigObject? I mean, I see the full classname of the PosConfigObjects but the ModuleNr as stated in the DisplayMemberPath is not rendered.
My PosConfigObject also has a list of IBaseConfigObjects, I want to stop the drawing of the map at "PosConfigObject" as I do not want to display the objects that the PosConfigObject has. Is there a way to achieve this? I tried it with the Visiblity="Hidden" but that does not seem to be working.
Attached please find the modified example.Thank you.
I did some investigating to see if I couldn't nail down the logic behind the NodeLayout. Since all of your nodes implement IBaseConfigObject, I would expect that if you created a single NodeLayout for IBaseConfigObject that it would show all the nodes in your hierarchy. It's also weird how it shows a node layout for TreatmentConfigObject and StorageConfigObject even though I take out the NodeLayout for them. I think ultimately we'll have to get the developers to look into this so I've logged a development issue regarding this. The ID is 169962. I've also created a private case (CAS-134835-T8T2F8) for you so that I can link the development issue to it. This way you can view the status of the development issue connected to this case by selecting the "Development Issues" tab when viewing this case on the Infragistics web site. https://www.infragistics.com/my-account/support-activity
In the mean time, if you want to hide the last set of nodes then I recommend collapsing the PosConfigObject nodes and then hiding the expansion indicator. You can create a style that targets the OrgChartNodeControl and add an EventSetter to the style for the Loaded event. Inside the loaded event you can collapse the node. Inside the NodeLayout there is a property called ExpansionIndicatorVisibility that you can set to hide the indicator. This will give you the appearence you desire.
<Style TargetType="{x:Type ig:OrgChartNodeControl}" x:Key="myNodeStyle"> <EventSetter Event="Loaded" Handler="OnNodeControlLoaded"/> </Style> <ig:OrgChartNodeLayout DisplayMemberPath="PosIdx" TargetTypeName="PosConfigObject" ExpansionIndicatorVisibility="Collapsed" NodeStyle="{StaticResource myNodeStyle}"/>
private void OnNodeControlLoaded(object sender, RoutedEventArgs e) { OrgChartNodeControl nc = sender as OrgChartNodeControl; if (nc.Node.Data is PosConfigObject) nc.Node.IsExpanded = false; }
Thank you for the workaround by hiding the last nodes. Thats exactly what I was searching.
I am looking forward to the developers comment.