cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
seadude
Level 10

Galleries and Parent.X/Y

Moving further along with Components and ran across something weird in regards to Gallerys and using Parent.X or Parent.Y.

The Microsoft Responsive Docs states that Galleries are a type of container that can handle Parent.values

"Later in this topic, you'll apply these principles (and the Parent operator) to position controls inside other containers, such as galleries, group controls, and components."

It goes on to warn against Parent.Height/Width and use Parent.TemplateHeight/Width respectively.

I'm trying to use Parent.X/Y and getting weird results.

Example1:

- Gallery with a lone image control

- Setting the image control to Parent.X results in "32", the X value of the Gallery rather than the template.

- I wonder if a ".TemplateX" property is warranted?

image.png
Example2:

- If I set the Image Y control to Parent.Y, the Image Y is set to 784 which puts it off the screen.

- I wonder if a ".TemplateY" Property is warranted here?

image.png
Just some observations Smiley Happy

2 REPLIES 2
Super User
Super User

Re: Galleries and Parent.X/Y

Hi @seadude 

 

The issue you are seeing might be because of the X,Y coordinates that you are using in the image control. 
 
Here, Parent.X/Parent.Y refers to X/Y coordinate of gallery with respect to the whole Screen, if you put it as is in the image control, it binds the coordinates to the Gallery outline and not the whole screen.
 
ex. Gallery Coordinates: X:10,Y:235 with respect to whole screen and now if the height of your gallery is 150, and if the image Y coordinate is set to 235, it will definitely not be displayed as it does not exist in the current gallery bound limits, if you will increase the length of gallery, lets say to 300, then it will be visible. Its all about the relative coordinates on the control.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Community Support Team
Community Support Team

Re: Galleries and Parent.X/Y

Hi @seadude ,

Actually, the Parent.X and Parent.Y formula in the Image control within Gallery would return the X /Y coordinate value of Gallery with respect to the current Screen. But the X/Y property of the Image control is respect to the Gallery control rather than the screen.

 

In addition, the .TemplateX proeprty and .TemplateY property is not supported within Gallery control. If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.