Showing results for 
Search instead for 
Did you mean: 
Helper V
Helper V

How can I middle align an object in a gallery by setting the Y axis?

I have an image object in a gallery and want it to always be middle aligned within the gallery template. How can I configure the Y axis? I have tried taking the Parent.TemplateHeight/2, but that does not even remotely set the setting where it needs to be.

Super User II
Super User II

What happens when you use that expression?

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia

The Y position ends up really far down in the gallery outside of the template height. The Template Height is 85, so TemplateHeight/2 is 42.5, which places the image really far down outside of the template perimeter.

Impactful Individual
Impactful Individual

You need to take half the height of the image off the midpoint of the template, so it should be like (TemplateHeight /2) - (image.Height /2)

Community Support
Community Support

Hi @pwrappr01 ,

If you want to middle align an image object in a gallery via the Y axis, please take a try with the following workaround:


Set the Y property of the Image control within the Gallery to following:

(Parent.TemplateHeight / 2) - (Image2.Height / 2)


Please consider take a try with above solution, check if the issue is solved.


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.

That did it. I appreciate your help.

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Are Your Ready?

Test your skills now with the Cloud Skill Challenge.


Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (41,019)