简体   繁体   English

Silverlight DataPager-拆分为3X3吗?

[英]Silverlight DataPager - Split Into 3X3?

I have a ListBox bound to an observable collection. 我有一个ListBox绑定到一个可观察的集合。

I also have a data pager bound to the itemsource of the list box. 我还有一个数据传呼机绑定到列表框的itemsource。

I currently have the data pager set to only show up to 3 rows. 我目前将数据寻呼机设置为最多仅显示3行。

How would I go about changing the style ListBox style (or something else) such that I could have a 3X3 display? 我该如何更改样式ListBox样式(或其他样式),使我可以显示3X3? For example, the first three items in my observable collection would be displayed on the first row of the list box, horizontally next to each other, then the next row would contain the next three items in the observable collection? 例如,我的可观察集合中的前三个项目将显示在列表框的第一行中,水平并排显示,然后下一行将包含可观察集合中的下三个项目?

Any info would be greatly appreciated. 任何信息,将不胜感激。

Thanks. 谢谢。

Chris 克里斯

It sounds like you want to use an ItemsControl with a WrapPanel (from the Silverlight Toolkit) in the ItemsPanelTemplate. 听起来您想在ItemsPanelTemplate中使用ItemsControl和WrapPanel(来自Silverlight Toolkit)。

    <ItemsControl xmlns:controls="clr-namespace:Microsoft.Windows.Controls;assembly=Microsoft.Windows.Controls">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <controls:WrapPanel/>
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ItemsControl>

Here's a short tutorial about the WrapPanel: http://blogs.silverlight.net/blogs/justinangel/archive/2008/11/05/silverlight-toolkit-wrappanel.aspx 这是有关WrapPanel的简短教程: http : //blogs.silverlight.net/blogs/justinangel/archive/2008/11/05/silverlight-toolkit-wrappanel.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM