Designer - TreeCollection of items which have themselves a collection like treenodecollection causes error when adding items
-
I'd like to store components in a TreeStructure and wanted to be able to design the TreeStructure within the designer. So I've made a Class Item which itself has a Collection ItemCollection (this is the same like TreeNode which has itself a TreeNodeCollection). This should work and it worked, but: As I add my items and the subitems and want to save with "OK" there is the following error: "Object not set to an instance of an Object" - this happens only, if I add Items to a level higher than two: Item1 SubItem (OK) SubItem (Error when saving) Item2 Item3 ... I do not know which Object is null. Can anyone help me with this problem? Thank a lot! Stefan
-
I'd like to store components in a TreeStructure and wanted to be able to design the TreeStructure within the designer. So I've made a Class Item which itself has a Collection ItemCollection (this is the same like TreeNode which has itself a TreeNodeCollection). This should work and it worked, but: As I add my items and the subitems and want to save with "OK" there is the following error: "Object not set to an instance of an Object" - this happens only, if I add Items to a level higher than two: Item1 SubItem (OK) SubItem (Error when saving) Item2 Item3 ... I do not know which Object is null. Can anyone help me with this problem? Thank a lot! Stefan
I know my answer is not what you expected, but if you have a IDE you can go step by step into the code and find out why it doesn`t work. Your problem may come form a bad code line, or a wrong condition. I hope you understand...
-
I know my answer is not what you expected, but if you have a IDE you can go step by step into the code and find out why it doesn`t work. Your problem may come form a bad code line, or a wrong condition. I hope you understand...
Thank you for your answer. I design the Collection in the Form-Designer, so Debugging is not possible. The problem is that I cannot see what the Designer wants to code because the designer tries to put code and cannot because the code would be wrong, so I can't see what the designer want to write. Thanks Stefan