Do you know any controls inherited from the ItemsControl that have horizontal orientation of items?
+28
A:
Simply change the panel used to host the items:
<ItemsControl ...>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
HTH, Kent
Kent Boogaart
2009-06-27 09:43:21
Don't you need to add IsItemsHost="True" to the StackPanel ?
Thomas Levesque
2009-06-27 09:56:28
I believe that's only necessary if you're re-templating the entire control. See http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemspanel.aspx
Kent Boogaart
2009-06-27 10:10:59
Answer also holds for Silverlight
Scott
2010-04-23 06:53:51
A:
this is actually not going to work in many situations.
using a stackpanel means the contents won't stretch to fill the space.
you then have to set a fixed width on anything in the itemtemplate.
silverlame
2010-10-07 00:03:11