cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Mahipal
Level: Powered On

set autoheight to gallery control

Hi all,

 

How to set Autoheight to gallery control power apps?

 

Thanks,

Mahipal

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: set autoheight to gallery control

There is no auto-height for the gallery itself - the height of the gallery control is fixed. However, you can use what we call a gallery with flexible height, where the template (that is replicated for all items) can have different heights. You need to create a gallery that has that property, once the gallery is added you cannot change whether it has a flexible height template or not.

 

To add one, choose the last option in the gallery menu in the Insert tab:

ForumPost-001.PNG

When you have that, you can add controls that have the AutoHeight property (text box, HTML Text) to the gallery template. The authoring tool will display the first row in the size of the template, and the subsequent rows in the size that it needs to accomodate the content.

ForumPost-002.PNG

Notice that when you preview the app (or publish and open it in a device, for example), you'll see all the columns in the correct size.

ForumPost-003.PNG

Hope this helps!

2 REPLIES 2
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: set autoheight to gallery control

There is no auto-height for the gallery itself - the height of the gallery control is fixed. However, you can use what we call a gallery with flexible height, where the template (that is replicated for all items) can have different heights. You need to create a gallery that has that property, once the gallery is added you cannot change whether it has a flexible height template or not.

 

To add one, choose the last option in the gallery menu in the Insert tab:

ForumPost-001.PNG

When you have that, you can add controls that have the AutoHeight property (text box, HTML Text) to the gallery template. The authoring tool will display the first row in the size of the template, and the subsequent rows in the size that it needs to accomodate the content.

ForumPost-002.PNG

Notice that when you preview the app (or publish and open it in a device, for example), you'll see all the columns in the correct size.

ForumPost-003.PNG

Hope this helps!

mbrocchi
Level: Powered On

Re: set autoheight to gallery control

I got auto-height galleries working using the following formula for the height of the Gallery - 

 

CountRows(MyGallery)*GalleryCellHeight

 

GalleryItemHeight is the height of each cell within the Gallery. If you want to grow a container that the gallery is sitting within then you must also set that containers height to the same formula.  

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 531 members 5,231 guests
Please welcome our newest community members: