开发者

WPF: Tree Expansion key combination

Hi all I have created the WPF Tree which has three level of nodes.

Each will expand on mouse click or use of "+" key: With use of "TreeViewItem.Expanded".

Now I want to code Expansion of tree at load time. This is to save the Click of User to get the information.

I want to know below things from SO:

  1. Is there is any combination of key which will Expand all the tree nodes(As "+" will expand the 开发者_StackOverflow中文版one level of tree).
  2. Or Is there is any property to generate the Event for the expansion of nodes.


  1. No, nothing built in.
  2. No, again nothing built in.

That being said, it's a fairly trivial matter to intercept a key press event and enumerate your nodes and set the TreeViewItem.Expanded = true;.


TreeViewItem.ExpandSubTree will expand the item and all of its children. If the TreeViewItem happens to be the root item, the entire tree will be expanded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜