How to change the orientation of a UniformGrid control?

By default, UniformGrid displays its 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?

+6
wpf
source share
1 answer

The easiest way to insert them is in the order you want them to appear.

If you use UniformGrid as an ItemsPanel in a list and get items through a data binding, sort the collection in which you bind the data to your preferred order.

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


The page disappears.

Here (no image) from 2017-06-20.

What he does is by rotating the grid 90 degrees with the layout transformation, and then again rotating each element in the grid with a different layout transformation so that they are right.

+3
source share

All Articles