The Main Object is not part of any other group
The line
group = chart.CreateGroup(nodes[0]);
in the code below returns null, so the LoadGroup function throws a 'null' exception
public void CreateGroup(List<Node> nodes, GroupTypes GroupType)
{
Group group;
if (groups.ContainsKey(GroupType))
groups.Remove(GroupType);
if (nodes.Count > 0)
{
group = chart.CreateGroup(nodes[0]);
LoadGroup(group, nodes);
groups.Add(GroupType, group);
}
}
private void LoadGroup(Group group, List<Node> allnodes)
{
foreach (Node node in allnodes)
{
if (node != group.MainObject)
group.AttachToSideMiddle(node, (int)ArrowAnchors.Left);
}
}
This is happening when I nest groups, whereby a main object of one group will become a subordinate in a parent group.
I do not, however, have an occasion where an object will be used as a main object or a subordinate more than once
Very frustrating, any ideas?
Cheers
JC