tags:

views:

585

answers:

1

Hi,

How to display treeview inside a list view, actually this listview has headers namely workbook, description,date, so when I display the tree view inside the listview, the treeview should open as per the listview headers.

My question is : 1. How to insert treeview inside Listview and my xaml code is

<ScrollViewer VerticalScrollBarVisibility="Auto">
                            <ListView Name="lstViewWorkbooks" HorizontalAlignment="Left" >
                                <ListView.View >                                        
                                    <GridView >
                                        <GridViewColumn Header="WorkBook"  Width="200" DisplayMemberBinding="{Binding AnyWorkbook}" />
                                        <GridViewColumn Header="Description" Width="660" DisplayMemberBinding="{Binding DescName}" />
                                        <GridViewColumn Header="Date" Width="183" DisplayMemberBinding="{Binding WorkbookDate}" />
                                    </GridView>                                        
                                </ListView.View>
                                <TreeView HorizontalAlignment="Left" Margin="195,76,0,-76" Name="tviewPojectView" Width="120" />
                            </ListView>
                        </ScrollViewer>

I am using MVP architecture, with C# and wpf.

The treeview in the above xaml code is enough to display the data?

Please help me Thanks Ramm

A: 

If you want the tree view inside a cell in your grid, you need to place it inside the cell template for the correct column like this:

            <GridViewColumn Header="WorkBook"  Width="200" DisplayMemberBinding="{Binding AnyWorkbook}">
                <GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <TreeView HorizontalAlignment="Left" Margin="195,76,0,-76" Name="tviewPojectView" Width="120" />
                    </DataTemplate>
                </GridViewColumn.CellTemplate>
            </GridViewColumn>
Jerry Bullard