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

Notifications

Announcements

Community site session details

Community site session details

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard