I have used the above suggested code. And it is working fine if we expand the node using mouse.
But I am expanding tree view node from separate button click including the normal node expanding nature(on button click I am calling the script to expand the tree view node e.g: treeView.get_selectedNode().expand()). In this case the OnClientNodeExpanded, OnClientNodeCollapsed events are not firing.
Is there any way to fire the OnClientNodeExpanded, OnClientNodeCollapsed events even if we expand the tree view node using client side script ?