Completed
Last Updated: 04 Jan 2017 14:34 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 16 Dec 2016 11:45
Category: TreeView
Type: Bug Report
1
FIX. RadBreadCrumb - incorrect selection is shown when repopulating RadTreeView with data although the RadBreadCrumb.DefaultTreeView property is set to null
To reproduce: 

Add a RadTreeView and a RadBreadCrumb and two RadButtons on the form and populate the tree view with data. Use the following code snippet:

private void radButton1_Click(object sender, EventArgs e)
{
    this.radBreadCrumb1.DefaultTreeView = null;
}

Random rand = new Random();

private void radButton2_Click(object sender, EventArgs e)
{
    this.radTreeView1.DataSource = null;
    DataTable dt = new DataTable();
    dt.Columns.Add("Id");
    dt.Columns.Add("Name");
    for (int i = 0; i < 10; i++)
    {
        dt.Rows.Add(rand.Next(0, 20), "Node" + i);
    }
    this.radTreeView1.DataSource = dt;
    this.radTreeView1.DisplayMember = "Name";
    this.radTreeView1.ValueMember = "Id";

    this.radBreadCrumb1.DefaultTreeView = this.radTreeView1;
}

Select some node in RadTreeView, the RadBreadCrum is updated respectively. Then click the first button to detach RadTreeView from RadBreadCrumb. Click the second button to populate RadTreeView with new data and associated the RadBreadCrumb with RadTreeView again. As a result you will notice that the last selected node will be loaded.

Workaround: clear the selection in RadTreeView before associating the RadBreadCrumb with RadTreeView:

this.radTreeView1.ClearSelection();
this.radBreadCrumb1.DefaultTreeView = this.radTreeView1;
Attached Files:
0 comments