views:

722

answers:

1

In Silverlight 3 I have a TreeView bound to an ObservableCollection in my ViewModel. The items are formated with a Hierarchical Data Template. When the collection is populated from a WebService and the TreeView displays that collection, it scrolls to the bottom of the list.

How would I go about finding a particular item that might be anywhere in the Hierarchy? And more importantly, how would I scroll that item either to the middle or top of the TreeView control?

A: 

To do this with the Toolkit Treeview you would have to write an attached behaviour - sorry not familiar enough with these to help on that.

However, you can do this out-of-the-box with the Telerik treeview control which has a feature called Bring into View.

Details on this feature can be found at http://www.telerik.com/help/silverlight/radtreeview-features-treeviewitem-bring-into-view-support.html. Downside is that this control is not free :-(

HTH, Mark

Mark Cooper