ItemsControl with horizontal orientation

Viewed 83786

Do you know any controls inherited from the ItemsControl that have horizontal orientation of items?

5 Answers

Simply change the panel used to host the items:

<ItemsControl ...>
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl>

For a long list with hundreds or even thousands of items, you should better use VirtualizingStackPanel to avoid performance issues.

Related