Click here to Skip to main content
11,584,040 members (62,731 online)
Click here to Skip to main content

Tagged as

Multi selection TreeView in WPF... the easy way.

, 30 Jan 2010 CPOL 14K 2
Rate this:
Please Sign up or sign in to vote.
Want to use multi selection in WPF TreeView ? <Setter Property="BorderBrush"...
Want to use multi selection in WPF TreeView ?

<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="BorderThickness" Value="1"></Setter>
<Style.Triggers>
<Trigger  Property="c:TreeViewExtensions.IsSelected"  Value="True" >
 <Setter Property="BorderBrush" Value="Gray"></Setter>
</Trigger>
</Style.Triggers>
</Style>
 
...
 
<TreeView c:TreeViewExtensions.EnableMultiSelect="true"
c:TreeViewExtensions.SelectedItems="{Binding SelectedItems}"
ItemsSource="{Binding Items}"
... />


Code and sample on my blog[^].

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Nicolas Dorier
Software Developer Freelance
France France
I am a trainer and a curious developer.

CEO of AO-IS, we created a tool to make IaaS on Azure more easy IaaS Management Studio.

If you are interested for working with me, for fun coding stuff, for freelance stuff, or interested in using our cloud training infrastructure freely for a kickass presentation for the dev community ? this way Smile | :)

You may also be interested in...

Comments and Discussions

 
GeneralReason for my vote of 1 it's bad Pin
bean_dou27-Dec-11 1:08
memberbean_dou27-Dec-11 1:08 
GeneralRe: what is bad ? do you have a better solution ? Pin
Nicolas Dorier27-Dec-11 1:23
memberNicolas Dorier27-Dec-11 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 30 Jan 2010
Article Copyright 2010 by Nicolas Dorier
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid