0

I have a treeview with checkboxes in WPF window. I have used togglebuttons for treeviewitems. Now the problem is that, i am searching the node from treeview but i cant set its Isselected property or focus on that node. How to do that?

SoniW
  • 11
  • 5

1 Answers1

2

If you implemented MVVM pattern correctly, the only thing you need is find your tree node on the model and set its IsSelected property to True.

You do not need any UI acceess from your code, in this case.

Tigran
  • 61,654
  • 8
  • 86
  • 123
  • I am using Viewmodel, but cant set its isselected property. – SoniW Nov 30 '11 at 07:05
  • @user961118: IsSelected should be the property of the model. Look here how to achieve what you want: http://stackoverflow.com/questions/940243/how-to-select-treeview-item-from-code – Tigran Nov 30 '11 at 07:58