Reputation: 7028
I have a list view in which each list view item is an expander control. Now when I click on expander to open or close it, I want the item to be selected also. But its not happening. Only expander expands.
Looks like my event from expander is not reaching to the list view.
Any idea how to do it?
Thanks
Upvotes: 2
Views: 1124
Reputation: 51
Inside the "ListView" set the container style like this...
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Style.Triggers>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="IsSelected" Value="True"/>
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
Got answer from: Link
Upvotes: 3