由网友(烈酒焚身)分享简介:这怎么可能以编程方式选择在WPF 的TreeView 的项目?该的ItemsControl 模式似乎prevent吧。How is it possible to programmatically select an item in a WPF TreeView? The ItemsControl model see...
这怎么可能以编程方式选择在WPF 的TreeView
的项目?该的ItemsControl
模式似乎prevent吧。
How is it possible to programmatically select an item in a WPF TreeView
? The ItemsControl
model seems to prevent it.
推荐答案
这是一些奇怪的原因,你必须使用ContainerFromItem拿到容器中,然后调用选择方法,一个真正的痛苦。有一个关于如何做到这一点的博客条目here.
It's a real pain for some strange reason, you have to use ContainerFromItem to get the container, then invoke the select method. There's a blog entry on how to do it here.
相关推荐
最新文章