How to put 2 ListBoxItem on same row?

Since everything is possible in WPF (well almost) this should be a pieece of cake.
when you have a number of ListBoxItems in a ListBox, they′re listed one item per row.
But what if my ListBox.Width = 300 and my ListBoxItem.Width = 100 then there′s some waste of space. Before I dig in to it I just want to know if the way to do it (if doable) is by overriding some methods that′s placing the itmes out so I can manually place them out, animate them etc..
Well, why don′t I use like a Stackpanel ? I need to use a control that inherits from ItemsControl so I can use ItemsSource to databind my object in xaml.
Would be grateful for some hints in the right direction
Have a nice day
/erik
[732 byte] By [ErikBN] at [2007-12-24]
# 1
...and by ovveriding the layout of my Items, will that affect any user interacting? Like the keyUp, keyDown etc...
/e
ErikBN at 2007-10-8 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

try something like this

<ListBox Name="item1">

<ListBox.ItemsPanel>

<ItemsPanelTemplate>

<UniformGrid IsItemsHost="True" Columns="3"></UniformGrid>

</ItemsPanelTemplate>

</ListBox.ItemsPanel>

</ListBox>

leed at 2007-10-8 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
ok, totally missed the ItemsPanel but the name explains it all!
thanks for the help
ErikBN at 2007-10-8 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 4
You'd probably want to use a FlowLayoutPanel to do what you want. It's child elements can be any size and it will automatically adjust the layout as the panel resizes. There are even some examples out there to add a little flourish to the layout process.
ivolved_Mike_Brown at 2007-10-8 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 5
Using WrapPanel as the ControlTemplate for ListBox is a simple way to do this. Be sure to set the WrapPanel attribute IsItemsHost = "true".
GregMcPherran at 2007-10-8 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified