K
Kristopher Wragg
I'm having some serious problems with the TreeView control.
I've got a control that inherits TreeView and has some methods that
firstly create a TreeNode then does some recursive procedure to add all
the children from a database of a sort. Then once this is complete I
clear the nodes, then add the TreeNode so it should be the only root
node.
The only problem is that for some very VERY strange reason there are
two root nodes, with duplicate child nodes. This is very bizare as
this.Nodes.Count returns 1 and base.Nodes.Count also returns 1, so
there SHOULD be 1 root node but there are two.
Also, I created another TreeView inherited control that would act as
the base for this other TreeView which does all the painting by me, so
that I can have different colors for highlighting and some other things
and to make it double buffered and not flicker like mad but when I use
this control as the base instead of the .NET one when I do
this.Nodes.Add it basically blows the control up in Internet
Explorer...
So basically the TreeView is driving me slightly nuts, either I can
have a TreeView with duplicate nodes that flickers when it updates the
nodes, else I can have one thats flicker free and nice but only works
when I add the nodes in edit mode, if I try adding them in code it
kills Internet Explorer...
any ideas? I'm already invoking back on the UI thread if it's needed to
add the root node, so I know the problems not that...
I've got a control that inherits TreeView and has some methods that
firstly create a TreeNode then does some recursive procedure to add all
the children from a database of a sort. Then once this is complete I
clear the nodes, then add the TreeNode so it should be the only root
node.
The only problem is that for some very VERY strange reason there are
two root nodes, with duplicate child nodes. This is very bizare as
this.Nodes.Count returns 1 and base.Nodes.Count also returns 1, so
there SHOULD be 1 root node but there are two.
Also, I created another TreeView inherited control that would act as
the base for this other TreeView which does all the painting by me, so
that I can have different colors for highlighting and some other things
and to make it double buffered and not flicker like mad but when I use
this control as the base instead of the .NET one when I do
this.Nodes.Add it basically blows the control up in Internet
Explorer...
So basically the TreeView is driving me slightly nuts, either I can
have a TreeView with duplicate nodes that flickers when it updates the
nodes, else I can have one thats flicker free and nice but only works
when I add the nodes in edit mode, if I try adding them in code it
kills Internet Explorer...
any ideas? I'm already invoking back on the UI thread if it's needed to
add the root node, so I know the problems not that...