Question: I have some hierarchical data that I need display as a table, can I change the style of a TreeView to display the data in List-like manner ?

so instead of:

```
+Group1
  SubItem1
  SubItem2
+Group2
 +Group
   SubItem11
   SubItem12

```

I want this:

```
Group1
SubItem1
SubItem2
Group2
Group
SubItem11
SubItem12

```

My code looks like this:

```
<TreeView ItemsSource="{Binding RootItems}"
                  dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True">
            <TreeView.ItemContainerStyle>
                <Style TargetType="{x:Type TreeViewItem}">
                    <Setter Property="IsExpanded" Value="true" />
                </Style>
            </TreeView.ItemContainerStyle>

            <TreeView.Resources>
                <HierarchicalDataTemplate DataType="{x:Type vm:CategoryViewModel}" 
                                          ItemsSource="{Binding Children}">
                    <v:Category DataContext="{Binding}" />
                </HierarchicalDataTemplate>
                <DataTemplate DataType="{x:Type vm:ItemViewModel}">
                    <v:Item DataContext="{Binding}" />
                </DataTemplate>
            </TreeView.Resources>
        </TreeView>

```

I know I should probably be able to work with the style of the TreeView, but I don't know where to start, and I couldn't find any information in this direction.

NOTE: duplicate of [Can I have a Treeview without the tree structure?](https://stackoverflow.com/questions/1526925/can-i-have-a-treeview-without-the-tree-structure)

Answer: 
Override the `TreeViewItem` template, e.g.

```
<TreeView.ItemContainerStyle>
    <Style TargetType="TreeViewItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TreeViewItem">
                    <StackPanel>
                        <ContentPresenter x:Name="PART_Header" ContentSource="Header"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <ItemsPresenter />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</TreeView.ItemContainerStyle>

```
You need to override the `default template of treeview` to flatten your hierarchy.
These links might serve your purpose -

[Can I have a Treeview without the tree structure?](https://stackoverflow.com/questions/1526925/can-i-have-a-treeview-without-the-tree-structure)

<http://social.msdn.microsoft.com/Forums/en/wpf/thread/a5ce0a21-d34b-4f9e-be03-ac4c56840ca5>