I am not quite sure that I had fully understand the encountered issue. Could you specify if the issue is that you are unable to add child nodes programmatically (from code-behind) or the template in not applied on those items? As I can see the referenced code snippet for programmatically adding of the child nodes - you set them as checkable, while you use the Template of the nodes for this purpose.
In addition, once a node is added to the collection, you should call the DataBind() on it, so that the template could be correctly applied. In addition, the items should have the same structure as the evaluated items from the datasource for the proper visualization of the node.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.