To reproduces: add a RadTreeView and set up Object-relational hierarchy. Use the following code:
NorthwindEntities context = new NorthwindEntities();
public Form1()
{
InitializeComponent();
context.Categories.Load();
context.Products.Load();
this.radTreeView1.DataSource = context.Categories.Local.ToBindingList();
this.radTreeView1.DisplayMember = "CategoryName\\ProductName";
this.radTreeView1.ChildMember = "Categories\\Products";
}
private void radButton1_Click(object sender, EventArgs e)
{
this.radTreeView1.ChildMember = "Products\\Categories";
this.radTreeView1.DisplayMember = "ProductName\\CategoryName";
this.radTreeView1.DataSource = context.Products.Local.ToBindingList();
}
When you click the RadButton, NullReferenceException occurs.
Resolution: Add more descriptive exception message.