Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ItemsControl with horizontal orientation

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

like image 516
user101375 Avatar asked Jun 27 '09 07:06

user101375


2 Answers

Simply change the panel used to host the items:

<ItemsControl ...>
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
</ItemsControl>
like image 76
Kent Boogaart Avatar answered Nov 12 '22 22:11

Kent Boogaart


While the promoted answer is great, here's an alternative if you want the items to stretch.

<ItemsControl.ItemsPanel>                              
    <ItemsPanelTemplate>
        <UniformGrid Rows="1" />
    </ItemsPanelTemplate>
</ItemsControl.ItemsPanel>   
like image 35
NielW Avatar answered Nov 12 '22 21:11

NielW