Click here to Skip to main content
11,718,016 members (80,484 online)
Click here to Skip to main content

Tagged as

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

, 30 Jan 2010 CPOL 14.6K 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 currently the CTO of Metaco, we are leveraging the Bitcoin Blockchain for delivering financial services.

I also developed a tool to make IaaS on Azure more easy to use IaaS Management Studio.

If you want to contact me, go 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.150901.1 | Last Updated 30 Jan 2010
Article Copyright 2010 by Nicolas Dorier
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid