Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Control positioning with a flexible gallery

(0) ShareShare
ReportReport
Posted on by 714 Super User 2025 Season 1

I have three controls on the left side of a gallery that I want to center within the gallery row as a group.

 

This sort of works:

Parent.TemplateHeight/2 - (Self.Height+lblApproverName.Height+lblApproverStatus.Height)/2

 

It works when I set the the TemplateSize to any value that is less than or equal to the math that works. For example, 100 just happens to perfectly work given the size of visible controls.

When that gallery row grows because a label and input that are made invisible and height=0 in certain conditions are visible for some users, the image and labels are in the wrong place.

 

It seems to always use the integer in the TemplateSize property rather than a dynamic height value based on the current gallery row.

 

Is there a Gallery property that represents the height of the specific row itself?

Categories:
  • Verified answer
    DCHammer Profile Picture
    714 Super User 2025 Season 1 on at
    Re: Control positioning with a flexible gallery

    I figured this out. There may be another way but what I chose to do is calculate the height of the gallery row by summing the heights of the controls. Since I dynamically shrink the height to zero when the control is NOT visible, the math works.

    I also dropped the number into a label so that I could see it changing as I was messing with the math. 

    Then I simply replaced Parent.TemplateHeight with Value(txtRowHeight.Text).

     

    Shout out to Michelle Sanchez at The Loading Point. It was her YouTube video that solved it for me.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,942 Most Valuable Professional

Leaderboard