3
Answers

Grid problems

John Nolan

John Nolan

13y
1.6k
1
Hi Guys,

for some reason binding my data to this in the grid only causes my phone to display everything inside row 0

thanks for the help

[code]
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--<Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>-->
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" ShowGridLines="True" Margin="12,0,12,0"> 
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <ListBox Height="650" HorizontalAlignment="Left" Margin="11,17,0,0" Name="listBox1" VerticalAlignment="Top" Width="434" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal"> 
                            <TextBlock Grid.Column="0" Text="{Binding test}"/>
                            <TextBlock Grid.Column="1" Text="{Binding test1}"/>
                            <TextBlock Grid.Column="2" Text="{Binding test2}"/>
                            <TextBlock Grid.Column="3" Text="{Binding test3}"/>
                            <TextBlock Grid.Column="4" Text="{Binding test4}"/>
                            <TextBlock Grid.Column="5" Text="{Binding test5}"/>
                            <TextBlock Grid.Column="6" Text="{Binding test6}"/>
                            <TextBlock Grid.Column="7" Text="{Binding 7}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>
[/code]

Answers (3)