Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make uniformgrid vertically

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.

like image 208
Calvin Avatar asked Dec 19 '12 01:12

Calvin


1 Answers

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 example on MSDN.

This one will display:

1 4 7
2 5 8
3 6 9

Is this what you mean?

like image 114
sa_ddam213 Avatar answered Oct 14 '22 02:10

sa_ddam213