Quantcast
Channel: Joe Stevens' Blog » Silverlight
Viewing all articles
Browse latest Browse all 9

Setting the SelectedItem in a Silverlight TreeView

$
0
0
I wanted to select a specific item in my Silverlight TreeView programatically.  Looking at the TreeView.SelectedItem property the setter is not public so it cannot be done this way. If you are simply adding TreeViewItems to the TreeView you can cast the item you want to select in the Items collection to a TreeViewItem and set the IsSelected property to true. The following example will grab the first item and set it to selected. If you are binding a list …

Viewing all articles
Browse latest Browse all 9

Trending Articles