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

Flexible height gallery doesn't adjust

Hello, here's what I'm trying to make: I want to make an "accordion" style nested gallery similar to what's shown in this video: Power Apps Accordion Gallery (Expand/Collapse Gallery) - YouTube. The user should be able to click items in the parent gallery to expand its child gallery. They should be able to click it again to hide it. Everything should shift up and down accordingly to conserve space. 

 

Here's my issue: the galleries don't seem to be adjusting like they are in the YouTube video. Both the parent and child galleries are flexible height galleries. When a child gallery item isn't visible, it just leaves a big white space as shown below.

 

Screenshot 2022-08-05 155144.png-mh.png

1 REPLY 1
cwebb365
Super User
Super User

Doing this is very frustrating thing to work with. You got to basically make sure you build in the height of the child gallery from how many items you have in that child gallery. So the Height Property of child gallery is set to something like "CountRows(Self.AllItems) * 50" or the height of your child item site needs to be. So 50 in my case. In your case you would attach that to your minimize effect. So the height would be on a condition saying 0 if no items in it, else CountRows(Self.AllItems) * 50  etc. 

 

You can't really get a double auto adjustment unfortunately. At least from my experience, and you got to get it close based on setting the child gallery size which the parent adjusts too is the only way  I could get it to work, and even that video I believe has that mixed in there. 

 

Good luck! I've lost some hair trying to get these things working right! 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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