The default items panel for a ListView
is a vertically-oriented StackPanel
. Since each number comes as a separate item for the ListView
and each row is bound to an item, you can't have different columns in one row bind to different items in the bound collection.
However, you can have a ListBox
or a ListView
that uses WrapPanel
as items panel. If you use ListView
, you'll have single-column items, and the wrap panel will take care of the proper items layout. However, I'd actually stick with ListBox
, unless you need some ofthe advanced ListView functionality.
To change the items panel, use the ItemsPanel
property. Here's an example in XAML:
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
The alternative is to change the ControlTemplate
for the ListView
and use the IsItemsHost
property (specify IsItemsHost="True"
) on the panel that you want to act as the items panel.
Edit: Updated to use the proper terminology. When I said item container, I meant items panel. That's what happens when answering from an iPhone.