web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Control positioning wi...
Power Apps
Answered

Control positioning with a flexible gallery

(0) ShareShare
ReportReport
Posted on by 716 Moderator

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:
I have the same question (0)
  • Verified answer
    DCHammer Profile Picture
    716 Moderator on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,074

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 606

Last 30 days Overall leaderboard