Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create a listbox with a Listview for the data template in your xaml code:</p> <pre><code>&lt;Grid&gt; &lt;ListBox Height="100" HorizontalAlignment="Left" Margin="10,10,0,0" Name="lbxTasks" VerticalAlignment="Top" Width="120"&gt; &lt;ListBox.GroupStyle&gt; &lt;GroupStyle /&gt; &lt;/ListBox.GroupStyle&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;ListView ItemsSource="{Binding Queue}" BorderThickness="0"/&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; &lt;/Grid&gt; </code></pre> <p>Then for your code behind, create and bind the lists. This is an example to test with:</p> <pre><code>namespace WpfApplication3 { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } List&lt;string&gt; pending = new List&lt;string&gt; {"1","2"}; List&lt;string&gt; busy = new List&lt;string&gt; { "4", "5" }; List&lt;string&gt; completed = new List&lt;string&gt; { "7", "8" }; private List&lt;Tasks&gt; MyTasks() { List&lt;Tasks&gt; tasks = new List&lt;Tasks&gt;(); tasks.Add(new Tasks {Status = "Pending", Queue = pending}); tasks.Add(new Tasks {Status = "Busy",Queue = busy}); tasks.Add(new Tasks {Status = "Completed", Queue = completed}); return tasks; } private void Window_Loaded(object sender, RoutedEventArgs e) { ICollectionView _tasksView = CollectionViewSource.GetDefaultView(MyTasks()); _tasksView.GroupDescriptions.Add(new PropertyGroupDescription("Status")); lbxTasks.ItemsSource = _tasksView; } } public class Tasks { public List&lt;string&gt; Queue { get; set; } public string Status { get; set; } } } </code></pre> <p>This creates a listbox for each Queue (or List) that you provide and groups it by the name of the List.</p> <p>The output:</p> <p><img src="https://i.stack.imgur.com/CArZy.png" alt="Output of the application"></p> <p>SOURCE: Modified the example from the link below into this format. <a href="https://stackoverflow.com/questions/10748385/listbox-grouping-using-collectionview-source">LISTBOX grouping using collectionView Source</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload