outlook email
outlook email

Reputation: 361

Master Detail Listview

I need to create a listview that looks similar to this:

enter image description here

But how can I add an expander to each row? Currently my XAML is far from what I need, but at least I have an expander and a list.

<ListView Grid.Row="1" Margin="5,0,5,5" ItemsSource="{Binding ListEmployeePerGroup, Source={x:Static vm:AttendanceInfoVM.instance}}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Emp_ID}" />
                        <TextBlock Text="{Binding Emp_Name}" FontWeight="Bold" />
                        <Expander>
                            <StackPanel Orientation="Horizontal">
                                <Label Content="{Binding Emp_ID}"/>
                            </StackPanel>
                        </Expander>
                    </StackPanel>

                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

So what do I need in order to make a listview similar to the one in the picture?

Thank you.

Upvotes: 1

Views: 1260

Answers (1)

Nuzumi
Nuzumi

Reputation: 26

There is expander implemented in WPF but not on listView, it's on DataGrid and is shown well in this tutorial https://wpftutorial.net/DataGrid.html in section Row Details. Hope it helps.

Upvotes: 1

Related Questions