Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change orientation of UniformGrid control?

By default, UniformGrid displays it's children as follows:

1 2 3
4 5 6
7 8 9

I want to be as follows:

1 4 7
2 5 8
3 6 9

Any ideas?

like image 886
Mik Kardash Avatar asked Sep 14 '10 17:09

Mik Kardash


1 Answers

Easiest must be to insert them in the order you want them to show up.

If you are using a UniformGrid as an ItemsPanel in a listbox and get the items through databinding, sort the collection you are data binding to your prefered order.

Finally, if you want to do it in the view, this link describes two ways: Building a Column-Major UniformGrid in WPF


The page keeps vanishing.

It's here (sans images) as of 2017-06-20.

What it's doing is rotating the grid 90 degrees with a layout transform, and then further rotating each item in the grid with another layout transform so they're right side up.

like image 106
Wallstreet Programmer Avatar answered Oct 03 '22 16:10

Wallstreet Programmer