[DevExpress Support Team: CLONED FROM T332969: How to generate shapes in DiagramControl from a hierarchical source]
Before proceeding to the connectors solution you just provided, I tried to implement the OrgChartController class approach. I made all the needed adjustments to cover the name, key and parent values but now I'm getting the attached runtime error on the stage the controller is getting my data source ("OnItemsSourceChanged" method).
Any ideas why this is happening? All 3 (name, key and parent) fields have values for all the items in the list I'm sending to the class.
Regards,
Andreas
NullReferenceException is raised when the OrgChartController.OnItemsSourceChanged method is called
Answers approved by DevExpress Support
The issue may occur when the ParentMember property points to a property that doesn't exist in the underlying data object or when there is a null value in the source collection.
Thanks,
Alexander
Hi Andreas,
I was able to reproduce this exception only with a source that contains null values. I have attached a sample project. Do you face this issue in the same scenario?
Thanks,
Alexander
Alexander,
I saw your sample project and indeed you are getting the same error but in my case I don't have a null item inside the list. Even in the case, I'm creating a dummy list with e.g. 3 items, I'm still getting the exception error.
The only differences that I can tell you at the moment is that your sample project is in C but mine is in VB. Also my "customer" class has more fields which some of them have null values but are not in used by the diagram class. I tried to add some more fields in your project with mix null and not null values but the sample project still is running fine.
Any other ideas?
Andreas
Hi Andreas,
It's also possible that the ParentMember property points to a property that doesn't exist in your underlying data object.
Thanks,
Alexander
Issue is now solved. Thanks a lot for all your help Alexander!
You are welcome, Andreas. I am happy to hear that the issue has been resolved!