Hi
Is it possible to save two objects in the tag property of a treeview node?
If so, how can I do so
Thanks bornagaindeveloper
Hi
Is it possible to save two objects in the tag property of a treeview node?
If so, how can I do so
Thanks bornagaindeveloper
No, but it is possible to write a third class which has two properties pointing to your classes and save this third object to the treenode tag. You could also use the Tuple class that has been introduced in .NET 4.0 if you don't want to write a third class yourself but I must admit that it could make your code more readable if you did.
You could store the values to array and store array in Tag.
node.Tag = new object[] {value1, value2};
value1_ = ((object[])node.Tag)[0];
...