zoukankan      html  css  js  c++  java
  • WPF listbox实现多列显示数据

    一.每行显示固定列数

    <ListBox ItemsSource="{Binding DataList}" Style="{DynamicResource ListBoxStyle}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <UniformGrid Columns="3"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                ...
                            </DataTemplate>
                        </ListBox.ItemTemplate>
    </ListBox>

    二.每行显示列数随宽度变化

    <ListBox ItemsSource="{Binding DataList}" Style="{DynamicResource ListBoxStyle}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>          
                                <WrapPanel IsItemsHost="True"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                ...
                            </DataTemplate>
                        </ListBox.ItemTemplate>
    </ListBox>

  • 相关阅读:
    python之使用openpyxl从excel读取测试数据004
    python之编写HttpRequest工具类003
    python之cookies获取002
    OJ练习9——T20 valid parentheses
    OJ练习8——T19 remove nth node
    OJ练习7——T14 Longest Common Prefix
    OJ练习6——T8
    OJ练习5——T6
    OJ练习4——T7
    九度OJ-1351
  • 原文地址:https://www.cnblogs.com/robertyao/p/10251351.html
Copyright © 2011-2022 走看看