Is there a simple way to set a TreeView's SelectedItem to null or equivalent? Also, I need to do this in C# and not in XAML.
Best regards,
Gabriel
Not sure what you mean
If you want to remove the item, use this:
treeView1.Items.Remove(treeView1.SelectedItem);
If you want to remove the selection from the treeview, use this:
((TreeViewItem)treeView1.SelectedItem).IsSelected = false;