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 / Setting Flexible Galle...
Power Apps
Answered

Setting Flexible Gallery Height inside Scrolling Canvas to remove gallery scroll wheel?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a form and a few galleries set inside a scrollable canvas, all vertically stacking. While two of the galleries have small values and a flexible gallery isn't necessary, another has a multi-line value, which requires a flexible gallery. I can remove the gallery scrolling in the non-flexible galleries using the formula: CountRows(GalleryName.AllItems) * 'X' ( where 'X' varies as needed), but how does one derive such a formula for a flexible gallery?  

Categories:
  • leyburn19 Profile Picture
    2,157 on at

    The way I adjust a flexible gallery is to use the separator or a rectangle (to look line a line) placed at the bottom of the row.   Then I set the Label that has multiple lines to Auto Height.  Then in the y property to the Rectangle or separator set it to label?.Height + 40

     

    This keeps the line 40 below the label no matter what height it is ( one or more lines).  I then adjust the row to bottom of the rectangle.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @leyburn19  thanks for your response. I'm referring to the overall height of the flexible gallery, not the individual rows. I have a flexible gallery sitting within a scrolling canvas, with other non-flexible galleries above and below it. I need to adjust the Height property of the flexible Gallery to some formula, so the scroll wheel of the flexible gallery disappears. This is straight forward with non-flexible galleries, but how to do it with a flexible gallery? Thanks.

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    Why set a formula for the height? if you are confident about the data and the height of each Datacard (rows in gallery) ! simply set the height of the Gallery and then turn off the Show Scrollbar for the gallery.

    if not you want to set the height of the gallery with formula only, here is the formula:

    Gallery11.TemplateHeight * CountRows(Gallery11.AllItems)

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

    Regards,

    Krishna
    If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @KrishnaV As stated, the flexible gallery in question sits in a scrolling canvas with another (non-flexible) gallery above and below it. I want all the records in the flexible gallery to appear and push the cards below the flexible gallery card down, and not have a second scroll just for the flexible gallery. Approaches using formulas CountRows(GalleryName.AllItems) * 'X'  or Gallery11.TemplateHeight * CountRows(Gallery11.AllItems) only work in non-flexible galleries, where all the rows are the same height. They don't work for a flexible gallery because of the number of rows and their heights change (flexible).  One ends up with white space at the end of the flexible gallery, or with a scroll depending on how many rows are associated with the record.  How does one make the overall height of a flexible gallery adjust according to the flexible row heights?

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Setting the overall height of a flexible gallery doesn't seem to have any straight forward resolve. There should just be an Autoheight option for the gallery so it can be set inside scrolling screens and other galleries. 

     

    My workaround for this, until that occurs, was to add a hidden label in the gallery, behind the label with the auto-height text appearing, ensuring it is the same width and padding, text size, etc.. I called this label 'NoRows', and added to its Text field: 

    (Len(TheLabelwithAutoHeightText.Text)/75)*1.2

    My understanding is that this is counting the text, dividing it by the number of characters (in my case approx. 75), and multiplying it by the line-height.

     

    Then changing the gallery height to the below"

    Sum(Gallery.AllItems,NoRows) * 30+10

    where (30) is essentially the padding around the label. This gave a much closer result, with some detail pages just short or long a bit, but the large differences are gone. Adding a bit more to the end (+10) helped ensure the scroll would disappear. 

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard