T
The Kiddie
Hi Guys,
I am doing some work with a treenode and I want to record the
selected item, and it may change while the user is performing some
tasks and I need to know which one was originally selected.
I want to create a property which will store the selected
TreeNode, and I can refer back to that when it is time to make the
changes. However I get a stack overflow error when I assign to the
propery. Here's the code
private TreeNode OperationNode
{
get
{
return OperationNode;
}
set
{
OperationNode = value;
}
}
I try to assign using OperationNode = TreeView.SelectedNode, and the
stack overflows. Any idea would be appreciated. I have used properties
with strings and int's no problem before but this is the first time I
am using them with a complex type. I'm not sure if I have to create a
new object somewhere, I was playing with Clone, but that creates a
different object to the one i want. I supposed I could clone and then
go through the tree and use the object.Equals function, but there must
be an easier way than that.....
Cheers,
JD
I am doing some work with a treenode and I want to record the
selected item, and it may change while the user is performing some
tasks and I need to know which one was originally selected.
I want to create a property which will store the selected
TreeNode, and I can refer back to that when it is time to make the
changes. However I get a stack overflow error when I assign to the
propery. Here's the code
private TreeNode OperationNode
{
get
{
return OperationNode;
}
set
{
OperationNode = value;
}
}
I try to assign using OperationNode = TreeView.SelectedNode, and the
stack overflows. Any idea would be appreciated. I have used properties
with strings and int's no problem before but this is the first time I
am using them with a complex type. I'm not sure if I have to create a
new object somewhere, I was playing with Clone, but that creates a
different object to the one i want. I supposed I could clone and then
go through the tree and use the object.Equals function, but there must
be an easier way than that.....
Cheers,
JD