RadTreeView Binding

2 posts, 0 answers
  1. Edward
    Edward avatar
    13 posts
    Member since:
    Aug 2010

    Posted 21 Jul 2010 Link to this post

    I have a usercontrol bound to a ViewModel containing a RadTreeView.  This is in a OutlookBarItem and displayed as a region in through a ContentControl. 

    In another region bound to another ViewModel I have some configuration RadioButtons and selection of the one of the RadioButtons eventually calls a method "XYZ" in the first ViewModel. 

    In the the "XYZ" method of the first ViewModel I set a dependency property which is an ObservableCollection<ABC> type.  My TreeView is bound to this dependency property.

    When I first bring up the application I go get all my needed data and fill three ObservableCollections - each ObservableCollection had nested Children of ObsrvableCollections. Some two deep some four deep ...

    I can get the RadTreeView to display the EntityTree dependency property that it is bound to initially.  But when I select an alternative radiobutton and set the dependencyproperty to the appropriate observable collection object, it does not refresh the RadTreeView on the view.   Do I have to do something to the region to get this refreshed?  Is the binding of the itemssource to this entitytree dependency property enough to get this radtreeview to refresh itself?  What's wrong?

  2. Hristo
    Hristo avatar
    352 posts

    Posted 23 Jul 2010 Link to this post

    Hi Edward,

    I'm attaching you an example that I hope will help you. SampleViewModel class extends ObservableCollection and is used to provide data to the treeview.
    If your model is more complex you can nest the ObservableCollection as a member of the ViewModel class. Then your ViewModel class must implement the INotifyPropertyChanged interface and fire the PropertyChanged event when changes are made to the ObservableCollection member. I left several comments in the sampleViewModel.cs file highlighting the milestones that must be performed when using ObservableCollection as a member.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top