开发者

Silverlight DataPager - Split Into 3X3?

开发者 https://www.devze.com 2022-12-21 22:33 出处:网络
I have a ListBox bound to an observable collection. I also have a data pager bound to the itemsource of the list box.

I have a ListBox bound to an observable collection.

I also have a data pager bound to the itemsource of the list box.

I currently have the data pager set to only show up to 3 rows.

How would I go about changing the style ListBox style (or something else) such that I cou开发者_开发问答ld have a 3X3 display? 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.

    <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

0

精彩评论

暂无评论...
验证码 换一张
取 消