如果 WPF 中的数据太多,如何使网格视图中显示的数据自动转到第二列

How to make data displayed in Grid View auto goes to second column if there is too much data in WPF

我正在创建某种队列管理系统,订单号显示在屏幕上。我不希望它们是可滚动的,而不是我希望当列表到达网格视图底部时数字自动跳转到下一列。

这是我当前的示例屏幕:

我不想像这样滚动,而是希望数字 235、234 等出现在 242、241 等旁边的第二列...我该如何实现?

下面是我的XAML代码:

        <ListView FontWeight="ExtraBold" BorderThickness="0" FontSize="50" Foreground="Blue" Width="580" Margin="0,113,0,0" Padding="30, 10, 0, 0" ItemsSource="{Binding PreparedList}" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Height="514" VerticalAlignment="Top">
        <ListView.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel Orientation="Vertical" />
            </ItemsPanelTemplate>
        </ListView.ItemsPanel>
        <ListView.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding PPosID}" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

谢谢。

我的缺点——使用 WrapPanel(我总是忘记名字)——同时禁用垂直滚动条:-

    <ListView FontWeight="ExtraBold" BorderThickness="0" FontSize="50" Foreground="Blue" Width="580" Margin="0,113,0,0" Padding="30, 10, 0, 0" ItemsSource="{Binding PreparedList}" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Height="514" VerticalAlignment="Top"
**ScrollViewer.VerticalScrollBarVisibility="Disabled"**>
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    **<WrapPanel Orientation="Vertical" />**
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding PPosID}" />
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

这是它的样子: