Hi,
I have created a small code sample in Visual Studio 2005 which used to work with v2.0.619 but not more with 2.2.0.0. I have figured around 1 day to track this down, I hope it helps you to make this superb product even better.
1. enter the form design and add a treelistview to the form with 3 columns. Enter these nodes to Column 1:
parent node: abcdefg01.hij
child node: Node 11
child node: Node 111
2. Add a button to the form
3. Run it with v2.0.619 and observe that the findNode(..) calls are working correctly
4. Build it with v2.2.0.0. Findnode still works correctly for the node added by the designer. But the last findNode call returns null on the programmatically added node.
Even more interesting, after the 1st run the node added by the designer cannot be expanded any more. Furthermore the node just added programmatically will not be displayed. Now we enlarge the size of Column1 a bit, and the programmatically added node appears. Now the node added by the designer can be expanded.
Now Click the button a 2nd time without stopping the debug session. The first findnode in the click handler only now returns a correct value. If we hadn't resized the column and performed a 2nd click, so the 1st FindNode in the click handler would have returned here too the wrong result: null.
Code:
namespace TestBugFindNodeInv2_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
TreeListViewNode C(int curBoxNr, LidorSystems.IntegralUI.Lists.TreeListViewNode parentNode)
{
TreeListViewNode Var1 = new LidorSystems.IntegralUI.Lists.TreeListViewNode(curBoxNr.ToString(), 7, 7);
parentNode.Nodes.Add(Var1);
return (Var1);
}
private void A(string cfName, string cfType, TreeListViewNode parentNode)
{
TreeListViewNode Var2 = new TreeListViewNode(cfName, 8, 8);
parentNode.Nodes.Add(Var2);
}
TreeListViewNode B(string outfilefullname)
{
TreeListViewNode Var3 = new LidorSystems.IntegralUI.Lists.TreeListViewNode(outfilefullname, 6, 6);
Var3.CheckBoxVisible = false;
return (Var3);
}
private void button1_Click(object sender, EventArgs e)
{
TreeListViewNode foundVNodea = treeListView1.FindNode("abcdefg02.hij", false, 0);
LidorSystems.IntegralUI.Lists.TreeListViewNode rootTriStateNodeInPreviewTree = null;
LidorSystems.IntegralUI.Lists.TreeListViewNode parentNodeOfC= null;
treeListView1.SuspendLayout();
TreeListViewNode result = treeListView1.FindNode("abcdefg01.hij", false, 0);
rootTriStateNodeInPreviewTree = B("abcdefg02.hij");
parentNodeOfC= C(1, rootTriStateNodeInPreviewTree);
A("0001", ".wvw", parentNodeOfC);
treeListView1.Nodes.Add(rootTriStateNodeInPreviewTree);
treeListView1.ResumeLayout();
TreeListViewNode foundVNode = treeListView1.FindNode("abcdefg02.hij", false, 0);
}
}
}