Problem with expand and collapse of node

The problem that i am facing is like when I point the mouse on the node object it shows the object title but when i point on its expand & collapse square its taking some random object becoz of this when i click to expand it shows the children of random node object and not the children of original object.

I’m sorry, but I’m unable to understand exactly what situation you are talking about.

I suggest you look very carefully at the references between the GoObjects and from the GoObject to your own data structures to make sure they are all what you expect. Make sure the GoNode has all and only the child GoObjects that you need. Make sure that if those node children have any references, that they point to the objects that you expect.
I suspect you have added a field to one of your GoObjects that is a reference to some object, and that when the GoObject was copied, that reference was not updated properly. When you define a field that is a reference, it is common to have to override the GoObject.CopyObject method (or the GoGroup.CopyChildren method, for references to sibling GoObjects) in order to fix up the new field's reference.
There are lots of examples of this throughout the sample applications.

In my application when u add a child to a node, a button(a small square with ‘+’ sign) is added to top-left part of the node to expand the node. Now the problem is for some node when i click the expand button it shows the child of some random node which is part of the diagram. I have written a code such that on right clicking the node there are options for collapse and expand , so when i right click and select expand the child node list is shown properly but on clicking expand button it doesn’t work. Please help.

Did you implement that button as a GoCollapsibleHandle, and have your node class implement IGoCollapsible? This just like in the TreeAppNode example class in the TreeApp sample.

If so, did you step through your implementation of Expand() to see which nodes it is making visible? The code ought to be getting precisely the same nodes as your context menu command is getting.

I am using the same expand function used in TreeAppNode. When i click the expand button the node that it is selecting is the random node not the original one.