首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Windows Mobile >

listbox内的textblock怎么分成3列

2013-07-11 
listbox内的textblock如何分成3列Grid Grid.Row1 Grid.ColumnDefinitionsColumnDefinition Width

listbox内的textblock如何分成3列
  <Grid Grid.Row="1" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>

                </Grid.ColumnDefinitions>
                <ListBox Name="listbox" Grid.Row="1" Grid.RowSpan="3">

                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal"  >

                                <<TextBlock Grid.Column="0" Text="{Binding Date}"></TextBlock>

                                <TextBlock Grid.Column="1"  Text="{Binding Customer}"></TextBlock>
                                <TextBlock Grid.Column="2" Text="{Binding Money}"></TextBlock>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>


                </ListBox>
            </Grid> wp7
[解决办法]


            <ListBox DataContext="1234567890-=" ItemsSource="{Binding}">
                
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border Margin="5" Width="140" Height="140" Background="Red">
                            <TextBlock Text="{Binding}" />
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <tookit:WrapPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>


热点排行