I have a treeview with several items in it. How do I force the treeView to select a specific item ? Everytime I try to use any of the “Selected…” property, I get the error that it is read-only and cannot be set either in code or in XAML.
Regards,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to create a
Selectedproperty on your tree item’s ViewModel, and bind to it.Here is an article that explains how to do it.
Edit. Actually that uses a different way. The article I was thinking of was this one