Reputation:
how to put an expander inside listivew?. I want to show expander as rows in listview.
Upvotes: 0
Views: 3505
Reputation: 4950
You could do something like this where you define the ListView style to place an expander around the GridViewRowPresenter
<ListView.Resources>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Expander Header="{Binding ColumnCaption}">
<GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.IsSharedSizeScope="True">
</GridViewRowPresenter>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.Resources>
Upvotes: 1