[Mono-bugs] [Bug 525002] New: Treeview behaviour different from .NET

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jul 24 08:54:46 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=525002


           Summary: Treeview behaviour different from .NET
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jxelam at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:

running Nodes.Clear() sets SelectedIndex on the TreeView to null on Mono, but
not on .NET, but not if run outside of the callback.

Steps to reproduce the problem:
1. Compile and run program below (-R:System.Windows.Forms)

using System;
using System.Windows.Forms;

class TreeTest {
    static void Main() {
        Application.Run(new TestForm());
    }
}

public class TestForm : Form {
    private TreeView treeView1;

    public TestForm() {
        Visible = false;
        treeView1 = new TreeView();
        Controls.Add(treeView1);

        treeView1.AfterSelect += new TreeViewEventHandler(afterSelect);
        treeView1.Nodes.Add("Test");

        treeView1.SelectedNode = treeView1.Nodes[0];
    }

    private void afterSelect(object sender, TreeViewEventArgs e) {
        treeView1.Nodes[0].Nodes.Clear();
        MessageBox.Show((treeView1.SelectedNode == null).ToString());
        Environment.Exit(0);
    }
}


Actual Results:

Message box containing "True"

Expected Results:

Message box containing "False"

How often does this happen? 

All the time

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list