Wrong number of nodes in SelectedNodes.

2 posts, 0 answers
  1. Mateusz
    Mateusz avatar
    13 posts
    Member since:
    Jul 2012

    Posted 04 Mar 2014 Link to this post


    Create new form and paste code below. 
    Run form, expand "root" node and select any item. SelectedNodeChanged event should write to console value "1".
    Then click button to rebuild re-build the tree, again expand "root" node and select any item.
    This time SelectedNodeChanged will write to console value: "2".

    private void Form1_Load(object sender, EventArgs e)
        RadButton b = new RadButton();
        b.Text = "Rebuild";
        b.Dock = DockStyle.Top;
        b.Click += b_Click;
        rtv = new RadTreeView();
        rtv.SelectedNodeChanged += rtv_SelectedNodeChanged;
        rtv.Dock = DockStyle.Bottom;
    RadTreeView rtv = new RadTreeView();
    private void rtv_SelectedNodeChanged(object sender, RadTreeViewEventArgs e)
    private void b_Click(object sender, EventArgs e)
    private void Rebuild(RadTreeView rtv)
        rtv.Nodes[0].Nodes.Add("level 1 item 1");
        rtv.Nodes[0].Nodes.Add("level 1 item 2");
        rtv.Nodes[0].Nodes.Add("level 1 item 3");
        rtv.Nodes[0].Nodes.Add("level 1 item 4");
        // this don't work
  2. Ralitsa
    Ralitsa avatar
    190 posts

    Posted 05 Mar 2014 Link to this post

    Hi Mateusz, 

    Thank you for contacting us. 

    We are aware of this issue with our RadTreeView. The issue was fixed in Q3 2013 SP1 (2013.3.1127) and one way to avoid it is to upgrade to the latest version. 

    If you do not want to upgrade your version of UI for WinForms you can use the workaround from feedback item: FIX. RadTreeView - Clearing the Nodes does not clear selected nodes

    Hope this will help you. Let me know if you have any another questions.


    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Back to Top