|
-
Mar 2nd, 2018, 01:31 PM
#1
[RESOLVED] Override TreeNode.Nodes.Add()
Hey all,
I have a class (myTreeNode) that inherits from TreeNode, and to myTreeNode I have added a class (customClass : IClonable) as a property.
When I add myTreeNode to a tree TreeView, the default customClass is used. When myTreeNode is added to another myTreeNode.Nodes collection, the childNode's customClass need to assume a clone of the parents customClass.
What I would like to do is override the Nodes.Add method from within the myTreenNode Class and clone the custom class there. I suppose I could override the entire Nodes collection and handle the Add, remove, etc methods, but all I need is to know when the child is added and have a reference to both the child and the parent at that time.
Any "easy" way to do this?
thanks for looking
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|