Debug break when scroll position needs to be changed.


This bug is rather critical. I used the latest version.
The TreeListView seems to preserve the scroll position after the nodes are cleared. The problem is that when there were many nodes in the list and the user has scrolled the list down far lower, then the nodes are cleared and fewer nodes are added, the TreeListView seems to recover the scroll position which is impossible.
Private Function _findFirstNode(ByVal aStartingNode As TreeListNode, ByVal aStartingPoint As Integer) As TreeListNode
    If aStartingNode Is Nothing Then
        System.Diagnostics.Debugger.Break() <-- This is triggered.
    End If
A simple application to reproduce the bug is below. Create a Windows Form application, then add a TreeListView and Button.
public partial class Form1 : Form
    public Form1()
    private void Form1_Load(object sender, EventArgs e)
        treeListView1.Columns.Add(new ContainerColumnHeader("Values"));
        for (int count = 0; count < 100; count++)
            treeListView1.Nodes.Add(new TreeListNode(count.ToString()));
        MessageBox.Show("Scroll down to the node 50 then press the [New Items] button");
    private void button1_Click(object sender, EventArgs e)
        treeListView1.Nodes.Add(new TreeListNode("1"));
Temporary workaround:
Reset scroll position manually.
treeListView1.VScroll.Value = 0;
Closed Apr 17, 2010 at 6:57 PM by spaccabit