Click here to Skip to main content
Click here to Skip to main content

Tagged as

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

, 30 Jan 2010 CPOL
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 | :)

Comments and Discussions

 
GeneralReason for my vote of 1 it's bad Pinmemberbean_dou27-Dec-11 2:08 
GeneralRe: what is bad ? do you have a better solution ? PinmemberNicolas Dorier27-Dec-11 2: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
Web03 | 2.8.141220.1 | Last Updated 30 Jan 2010
Article Copyright 2010 by Nicolas Dorier
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid