Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Set Y position of a container to the Y position of Item in a Gallery

(1) ShareShare
ReportReport
Posted on by 12
I am trying to set the Y position of a container to the Y position of an icon within an gallery. The issue is, is that the container needs to change Y position based on the row where the icon is being selected. For example, if there are 5 rows of data and I select the icon for the 3rd row the container would align its Y position to the Y position of that icon. I've tried various methods but this needs to be dynamic as I have sort capabilities on the each column in the gallery.
 
Thank you
Categories:
  • CU06090422-0 Profile Picture
    12 on at
    Set Y position of a container to the Y position of Item in a Gallery
    That did not work sorry. I may not have explained what I'm doing properly. I have a Horizontal Gallery, withing that gallery, I have a nested vertical gallery. For each item in that gallery is an icon. When I select that Icon, I have a container (that has a couple of galleries contained within), that I want to be visible and show next to the Icon selected. Now the Y may changed depending on which item is selected and I may want it to be slightly different based on the location of the icon to the bottom or side edge of the screen. I've attached an image of my layout with the container visible. 
    For example, If I select the icon for the first item I want the container Y property to be closer to the icon's Y property and if I select the 2nd item then the Y property is almost where it's currently sitting.
  • Suggested answer
    Nandit Profile Picture
    1,563 Super User 2025 Season 1 on at
    Set Y position of a container to the Y position of Item in a Gallery
     
    I have tried to recreate this with a button but should work with Container too. I have used the ID column for this. 
    If I select 1 from the gallery, the Button stays in front of 1:
    If I select 3, it goes in front for 3:
     
    Here's the Y value of the Button:
    Gallery.Y + Gallery.Selected.Title.Y + If(
        Gallery.Selected.ID = 1,
        0,
        (Gallery.Selected.ID - 1) * Gallery.TemplateHeight
    )
     
    Hope this helps you solve your problem. 
     
    Kind regards,
    Nandit
     
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
     
     

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,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard