Hi,
I am working on creating a project item container and project item inside it. I am adding both on ProjectOpen. A first-time project item is getting created perfectly. But problem is coming when I am refreshing the project item since we have a use case where due to some user interaction we need to show a new item in the project item. Because of this use case, I am refreshing the project item so that Fetch will again be called.
Talking first about my project item structure, since my project item will be 2 or 3 levels deep, besides the project item, I have also created a ProjectSubItem. First, I started with a very simple way in the Fetch method, which is to call ClearChildren(), which is clearing all the root and child items in my container. And recreating again. This way it is not working. Second, what I tried is I kept the top most node as it is, which means using some flag if that node is present in the existing project item's children, use the same, then first clear its children, and if not present, then create this main node. And then I am drilling inside its children and adding the children only after clearing them first. This way it is also not working.
In both ways, the first node's content is showing twice. For example, if the main node is named ParentNode, then inside this node if we have 2 levels, then at each level items are getting repeated even after clearing before adding them.
What is the best way to implement the Fetch in this case?
@UmaHarano @Wolf @GKmieliauskas @CharlesMacleod @NarelleChedzey