This is a migrated thread and some comments may be shown as answers.

Rebinding a TreeView

1 Answer 83 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Mark Bostleman
Top achievements
Rank 1
Mark Bostleman asked on 31 Aug 2009, 02:12 AM
I have a private instance of a collection of business objects on a form.  On form load, I fill the collection with data and bind it to a treeview.  In reaction to user input elsewhere on the form, I add and remove items from the collection.  At that point I need to refresh the binding of the TreeView.  I tried resetting the DataSource property and I've tried the Refresh and Update methods, but nothing I do makes the TreeView display the new data.

How do I do this?

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 31 Aug 2009, 04:32 PM
Hi Mark,

Thank you for writing.

In order to be compliant with the data binding mechanism of RadTreeView you need to support the basic interfaces which are provided by the WinForms library, namely, the IBindingList and INotifyPropertyChanged interfaces. IBindingList is provided automatically by the BindingList class. The INotifyPropertyChanged interface must be implemented by your business objects so that RadTreeView can react on direct object changes.
 
In short, your custom objects must implement INotifyPropertyChanged and your private collection must be of type BindingList or it must explicitly implement IBindingList.
Please write again if you need further assistance.

 
Sincerely yours,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Treeview
Asked by
Mark Bostleman
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or