itemspanel

how to make uniformgrid vertically

十年热恋 提交于 2019-11-30 17:35:39
I'm using UniformGrid and it's making the items display horizontally. Is there a way to make it display vertically? <ListView.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="3" /> </ItemsPanelTemplate> </ListView.ItemsPanel> Any help would be greatly appreciated. sa_ddam213 The WPF UniformGrid layout is horizontal only, e.g.: 1 2 3 4 5 6 7 8 9 Perhaps you could use a WrapPanel instead and just set the ItemHeight and ItemWidth to your desired grid size and set the Orientation to Orientation.Vertical . Or you could create a derived UniformGrid to handle Orientation , there is a good

WrapPanel as ItemPanel for ItemsControl

℡╲_俬逩灬. 提交于 2019-11-27 04:13:06
Still fooling around with WPF and learning as I go. Trying now to build a dynamic grouping of controls (mostly Buttons but might include CheckBoxes and others). I had no idea what was the best way to do this so I tried creating a ItemsControl style and then add the items into a ItemsPresenter inside a WrapPanel. Soon realized the items wouldn't wrap because they effectively weren't inside the WrapPanel unless I put it as ItemsHost. Like this: <Style x:Key="ButtonPanelGroup" TargetType="{x:Type ItemsControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type