This question is locked. New answers and comments are not allowed.
I'm doing the following on the TreeView control:
| private void SetSelectedItemOnControl(ITreeNode item) |
| { |
| var treeItem = treeView.ItemContainerGenerator.ContainerFromItem(item) as RadTreeViewItem; |
| if (treeItem != null) treeItem.IsSelected = true; |
| } |
This successfully retrieves the 'treeItem' node (a RadTreeViewItem).
The next line however, when I set treeItem.IsSelected = true fails with the error:
ArgumentException
Value does not fall within the expected range.
Any ideas why? In testing around with this, I can do other things on that item, like set toggling it's IsExpanded property successfully. So it's in the visual tree, and seemingly functioning.
What to do? Thanks!
