cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
barefaced
Frequent Visitor

Horizontal Gallery Wrap Count - Order of items being displayed

Hello, 

I have racked my brains on this one but struggling to fix (what might be deliberate behaviour). I have a horizontal gallery that displays fields to be completed by month for the number of staff that someone needs for a particular project. The wrap count for the gallery is set dynamically:

 

If(CountRows(Self.AllItems) >9, 2, 1)

 

The gallery sort order is currently set to:

 

SortByColumns(colTest, "RowNumber", SortOrder.Ascending)

 

I have also tried setting the sort order by the Value column of the collection (which is a date)

When the gallery wrap count is 2, the gallery correctly breaks to two rows BUT the order of the items doesn't run in ascending order in the first row and then break to the second row and continue running in ascending order (see image)

 

gallery sortgallery sort

Is there anything that I can do or is the horizontal gallery supposed to behave like this? It doesn't feel right to be tabbing down then up and across to complete the fields. 

Thanks

Nicki

1 ACCEPTED SOLUTION

Accepted Solutions
AmDev
Solution Sage
Solution Sage

Hi @barefaced 

 

Yes this is how a horizontal gallery behaves. with wrap count of 1, you just have one row with items ordered from left to right as per the Items property.

 

When you wrap to 2, it wraps the items vertically in each segent of the gallery as it works its way from left to right, i.e. 1+2, then 3+4 etc, which is why you are seeing this behaviour.

 

If you use a vertical gallery and set the wrap count to 9, this will wrap items 1-9 in the first row and 10,11,12 will spill over to the second row.

 

Is this what you are after?

View solution in original post

3 REPLIES 3
AmDev
Solution Sage
Solution Sage

Hi @barefaced 

 

Yes this is how a horizontal gallery behaves. with wrap count of 1, you just have one row with items ordered from left to right as per the Items property.

 

When you wrap to 2, it wraps the items vertically in each segent of the gallery as it works its way from left to right, i.e. 1+2, then 3+4 etc, which is why you are seeing this behaviour.

 

If you use a vertical gallery and set the wrap count to 9, this will wrap items 1-9 in the first row and 10,11,12 will spill over to the second row.

 

Is this what you are after?

View solution in original post

barefaced
Frequent Visitor

@AmDev very possibly. I will thrown a quick test into the app and mark this as solved if it does what I need. Thanks for the quick reply.

AmDev
Solution Sage
Solution Sage

Great stuff - Glad that worked out for you.

 

Good luck with the rest of the build!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,508)