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 / Change size of Gallery
Power Apps
Answered

Change size of Gallery

(0) ShareShare
ReportReport
Posted on by 26

Hi All,

 

I am trying to dynamically change the size of a gallery I have in my canvas app.

The gallery is based on a collection, typically the collection will consist of 3 or 4 items in it but can be more or less.

What I am trying to achieve is to change the size of the actually gallery itself depending on the number of items in the collection.

 

so if the collection has 1 record in it then the gallery height will only show the one item, if it has 4 then the gallery will have 4 items on display and then shrink to fit if I delete an item.

 

Apologies if this has been asked already, I did search but couldn't see a similar question/answer.

 

Thank You,

 

- Sukh

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Go to Template Size property of your gallery: let's say template size is 110.

    Now go to height property of the gallery. Write:

    110 * CountRows(Collection).

    That way if your collection have 3 records. Your gallery's height will be

    110 * 3 = 330.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SukhRehal 

    Change your Height property of your Gallery to:

      (Self.TemplateHeight + Self.TemplatePadding) * CountRows(Self.AllItems)

     

    I hope this is helpful for you.

     

  • SukhRehal Profile Picture
    26 on at

    Thank you guys for the quick response.

     

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard