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 / Is there anyway to acc...
Power Apps
Answered

Is there anyway to access a gallery cells individual coordinates or height/width?

(0) ShareShare
ReportReport
Posted on by 109

I have a very simple gallery that has one label in each cell. The label is populated from a column in my dataverse table and all the labels will have different lengths. I want my label to be dead center of each cell. Here's an example:

product page.PNG

While this looks fine, I know once a longer name appears the position of the (X , Y) coordinate, which is the upper left hand corner, will stay exactly the same. With auto-height on, the words will be visible but pushed down from where the (X, Y) coordinate is so it will look off centered. I want to be able to mathematically calculate the distance from the top of the cell to the bottom. The issue I'm having is trying to figure out how to access the cell positions and dimensions to calculate what I need.

 

Categories:
I have the same question (0)
  • Verified answer
    SBax Profile Picture
    1,348 on at

    I believe what you need is template width / template height 

     

    A variation on this formula in the X property of your label should do what you need

     

    YourGalleryName.TemplateWidth - Self.Width)/2 

  • mqcp Profile Picture
    109 on at

    @SBax Thank you. This worked in order to get my label inline along the X axis. In order to get it correctly placed on the Y I used:

     

    (MyGalleryName.TemplateHeight - Self.Height)/2

     

    (*had to make sure auto height was on so Y-coord dynamically changes )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard