I have a ListView
which is starting to have too many items to have on one window. I would have a ComboBox
to choose a subset to display, but all need to be available. I want to be able to collapse and expand logical portions of items, under parents. The number of groupings will be dynamic.
I need a ListView
not a TreeView
as the ListView
defines a custom ListBox
. To achieve this I followed this guide: http://blogs.msdn.com/b/permanenttan/archive/2009/01/19/wpf-listview-with-check-boxes-and-no-clipping.aspx
To summarise, it is had two columns, the first contains a CheckBox
, and the second contains a corresponding TextBlock
. This is so I can select a row without checking the box.
<ListView>
<ListView.View>
<GridView>
column definintions....
It is the <ListView.View>
which isn't available in TreeView
which is why I believe I must stick with ListView
.
Attempting to enclose the listview in a treeview didn't go well, it would result in me having to define separate listviews and therefore the whole column definition for each . As is my understanding. Avoiding a template too would be ideal but I would settle for this.
Ideally the ObservableCollection
which populates the ListView
can remain unchanged, I'd prefer not having a List of these.