views:

173

answers:

1

How can I get the headerclick event of a WPF Listview?

+3  A: 

You can use the GridViewColumnHeader.Click attached event. As an example, see the MSDN page on sorting a GridView when the header is clicked.

<ListView x:Name='lv' 
          Height="150" 
          HorizontalAlignment="Center" 
          VerticalAlignment="Center" 
          GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler">
Matt Hamilton
Thanks. This solved my problem.
Sauron
Is it a secret code? The property is not listed.
Sauron
Events that apply to children like that won't show up in Intellisense - the editor can't know which ones you might want to use!
Matt Hamilton