I usually do this by setting the HorizontalContentAlignment on the ListBoxItem 
style, changing it from Left to Stretch.

<ListBox ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{Binding 
Collection}">
       <ListBox.ItemContainerStyle>
              <Style TargetType="ListBoxItem">
                     <Setter Property="HorizontalContentAlignment" 
Value="Stretch"/>
              </Style>
       </ListBox.ItemContainerStyle>
</ListBox>

Using this approach will allow long lines to continue to scroll horizontally.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Miguel Madero
Sent: Monday, April 19, 2010 4:12 PM
To: ozSilverlight
Subject: Re: Ragged ListBox item widths

I found this yesterday:
http://10rem.net/blog/2010/04/18/silverlight-and-wpf-tip-fitting-items-in-a-listbox


--
Miguel A. Madero Reyes
www.miguelmadero.com<http://www.miguelmadero.com> (blog)
[email protected]<mailto:[email protected]>
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to