I’m really going mad … but the whole evening I’m trying to create a 3 column listbox. I want that the 3 columns are spread over the whole size of the listbox and not sticked together like they do when using the code below.
So, here’s my XML
<ListBox Background="Red" HorizontalContentAlignment="Stretch"
ItemsSource="{Binding ListItems}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" Background="Aquamarine">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="A"/>
<TextBlock Grid.Column="1" Text="B"/>
<TextBlock Grid.Column="2" Text="C"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Hope you can help me.
Right now I found a solution:
http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/d93281f3-d369-45b9-ae50-ce273941f959