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>

  • 相关阅读:
    如何将应用安装到/system/app下
    WPF Perf: RenderCapability.Tier & DesiredFrameRate
    DataGridComboBoxColumn为什么就不能在Binding的时候引用其他Named Element了呢?
    A366T使用技巧
    在XAML里面引用枚举值的注意点
    高斯消元bzoj1013球形空间产生器
    欧拉函数bzoj2818简单推导
    链剖进阶ing填坑NOIP2013货车运输
    .net 2.0 BackgroundWorker 文章三篇
    19号晚21号上午
  • 原文地址:https://www.cnblogs.com/robertyao/p/10251351.html
Copyright © 2011-2022 走看看