Is it possible to have a pure hierarchical wpf data grid? Now there are 3 possible solutions dicussed over the internet ...
- GroupStyle
- TreeListView instead of DataGrid
- RowDetailsTemplate
Now all 3 are not useful in my case as they each have limitations.
GroupStyle
provides grouped row presenters but their parent is simply GroupItem
. This is where my data source is different. In my case the parent of the grouped items will be of the same type of item.
e.g. Folder
class has List<Folders> children
. So the parent of child folders is of type Folder
itself.
RowDetailsTemplate
would need me to host another datagrid that is bound to Children
, but that would mean it would have its own column headers and what I want is the children to share the same column view of the parent DataGrid, just like they do in TreeListView
.
And for TreeListView
, thats what I am using right now, but its problem is ...
It looses virtualization and it is not a datagrid
:-)
I was thinking like some attached behavior that toggles the hierarchy view for the data grid like...
<DataGrid HierarchicalBehavior.HierarchyPath="Children" ... />
Where Children
is a property of type IEnumerable
under each item.
I hope you guys understand what I am getting at.
Any ideas?