Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Expanding Gallery

(2) ShareShare
ReportReport
Posted on by 4,507
I have working on creating a form with multiple galleries.

I need to incorporate the ability for each gallery to expand when a new item is added that goes beyond
the current boundary.

In the example the top gallery has four items, but the fourth one is partially hidden. Is it possible to make
the height of the gallery dynamic to the number of items within them?
Categories:
  • Verified answer
    Phineas Profile Picture
    Phineas 4,507 on at
    Expanding Gallery
    I figured it out using the following in the Height of the Gallery -
     
    With(
        {
            varCountRows: CountRows(
            colStockMaterialsItems)
         
        },
            varCountRows * Self.TemplateHeight + varCountRows * Self.TemplatePadding
    )

    The rectangle and Labels below the Gallery have the following, to keep up. Such formulas are also required for anything under the Gallery (with care to make sure the formula height, x and/or y apply to the correct item above).
        WO_Component_Gallery_3.Height + WO_Component_Gallery_3.Y
     
  • ANB Profile Picture
    ANB 7,060 on at
    Expanding Gallery
    Hi,
     
    You can have dynamic height using below code:
    CountRows(DataSource)*Self.TemplateHeight

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.


    Thanks,
    ANB
  • BD-01080338-0 Profile Picture
    BD-01080338-0 22 on at
    Expanding Gallery
    @ANB, thank you for your reply.
     
    The video provided is an excellent tutorial on 'TempleSize' height.
     
    I need to know if the height of the 'Gallery' itself can be set dynamically.
     
    In my scenario the user may have one or many items to enter into the Gallert. Unfortunately, as constructed, the Gallery only allow for the first three to be seen.
     
    The rest are only visible when using the scroll bar. This configuration all limits what us displayed when the screen to transformed into PDF and printed.
     
    I am trying to figure out if there is a way to expand thre main gallery so that it shows all items all the time, so that the PDF print will also print all the items in the Gallery.
  • ANB Profile Picture
    ANB 7,060 on at
    Expanding Gallery
     
     

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.


    Thanks,
    ANB

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard