简体   繁体   中英

Wpf groupstyle wrap panel

How do I use a group style with ItemsPanelTemplate, But I want the gorup to be stack horizntal and the wrappanel like this:

*************
*a:1 2 3 b:1*
*2 3 c:1 2 3*
*d:1 2 3 e:1*
*2 3 *
*************

I tried this:

<GroupStyle.Panel>
    <ItemsPanelTemplate>
        <WrapPanel Orientation="Horizontal" />
    </ItemsPanelTemplate>
</GroupStyle.Panel>

and with / without

<ListView.ItemsPanel>
   <ItemsPanelTemplate>
       <StackPanel Orientation="Horizontal"/>
   </ItemsPanelTemplate>           
</ListView.ItemsPanel> 

but it gave me

**************
*a:1 2 3 *
*b:1 2 3 *
*c:1 2 3 *
*d:1 2 3 *
*e:1 2 3 *
**************

I even tried the opposite way the group style panel to be stack and the list view to be wrap panel.

Try to use width:

 <WrapPanel Width=200px />

(the 200px value is for example)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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