Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
 View Only
  • 1.  Scrolling in nested galleries

    Posted Jul 23, 2021 10:48 AM
    I am building an app with a nested gallery and i´m currently struggeling with how to set the heights so that the scrolling works fine.
    Here´s how the structure is:

    I have a top gallery which is showing the weekdays (galWochentage). It has 7 items to show the week days / dates.
    Within this gallery, i have sub-gallery to show items from a sharepoint list which belongs to this date (galAufträge).


    My goal is, that you dont have a separate scrollbar for every column, but only one on the right side and that you can scroll until the last item.
    In the Gallery height of the sub gallery, i set the amount of rows * template height --> no scrollbars in the subgallery


    But the scrollbar of the top gallery doesnt scroll until the end but only until item Nr. 7.


    Is it somehow restricted or can i solve that by changing the heights?

    ------------------------------
    Fabian Heil
    ------------------------------


  • 2.  RE: Scrolling in nested galleries

    Posted Aug 23, 2021 03:20 AM
    ​Anyone an idea on this? :(

    ------------------------------
    Fabian Heil
    ------------------------------



  • 3.  RE: Scrolling in nested galleries

    Top Contributor
    Posted Aug 24, 2021 01:04 AM
    You might be able to get around this by setting the template height of the inner gallery dynamically. For example you can set the height of the inner gallery to Parent.TemplateHeight so it fits the height of the outer gallery then set the template height to be

    Self.Height / Max(ForAll(galWochentage.AllItems, CountRows(ThisRecord)),Value) or something along those lines. To be honest I'm not in a position to test this now and I'm not 100% sure that formula will work, but with a bit of hacking around you might manage to get it. What you;re trying to achieve though, is finding the outer gallery item that contains the most rows and setting the template height of the inner gallery so they all fit on the screen at once - no scrollbar.

    ------------------------------
    Will Page
    Technical consultant
    Christchurch, NZ
    ------------------------------



  • 4.  RE: Scrolling in nested galleries

    Posted Aug 25, 2021 02:35 AM
    I think, it doesnt work because of a limit of the gallery template height.
    The outer gallery is a horizontal gallery to show the week days in a line. There is no horizontal flexible height gallery available.
    I played around with the template height of the outer gallery, but when i reach a specific height, it doesnt change anymore. Are you aware, if there is any limit value of the template height of a horizontal gallery?

    Do you have any other idea how to achieve my idea?
    I want to show the week days in horizontal (Monday to Sunday) and in every day column, i want to show different amount of items vertical.
    But i dont want to scroll in every single column separately but for the whole week list.

    ------------------------------
    Fabian Heil
    ------------------------------



  • 5.  RE: Scrolling in nested galleries

    Bronze Contributor
    Posted Aug 25, 2021 09:10 AM
    Hi Fabian,

    I think I understand what you are doing now.  My thought would be to flip it around so that you have the Horizontal gallery as the inner gallery and the vertical gallery as your outer one.

    ------------------------------
    Steve Bolton
    Sr. Business Analyst
    ------------------------------



  • 6.  RE: Scrolling in nested galleries

    Top Contributor
    Posted Aug 25, 2021 05:03 PM
    It's the inner gallery template height I mean. Your outer gallery is dates, which I presume you've done with Something like AddColumns(Sequence(0,7),"Date" DateAdd(Today(),Value,Days)) while you inner gallery is like Filter (List, Date = ThisItem.Date)

    Is that more or less right? If so, then there will be a variable number of items in each instance of the inner vertical gallery. If that's the case then each instance of the inner gallery may or may not have a scroll bar depending on whether the number of items * template height > outer gallery height

    So, to avoid that happening, dynamically set the template height of the inner gallery such that it "compresses" down to fit all the items of the instance (date) which has the maximum number of items, within the height of the outer gallery.

    You can do this by counting the rows of each instance of the vertical inner galleries, taking the max value of that and dividing it by the fixed height of the horizontal outer gallery and using the result in the TemplateHeight property of the vertical inner gallery

    There are a couple of way you could achieve this, my example may or may not work, you could also count the rows in the formula of the outer gallery via a ForAll and pass that through as a property of the outer Items formula.



    ------------------------------
    Will Page
    Technical consultant
    Christchurch, NZ
    ------------------------------



  • 7.  RE: Scrolling in nested galleries

    Posted Aug 26, 2021 02:30 AM
    I worked around it, using an empty form control to allow scrolling.
    Seems to work with this :)

    Thanks for your help!

    ------------------------------
    Fabian Heil
    ------------------------------



  • 8.  RE: Scrolling in nested galleries

    Bronze Contributor
    Posted Aug 24, 2021 08:11 AM

    Hi Fabian,

    I had this same issue and in researching found this video that shows how to set a variable height for the inner gallery:

    PowerApps: Gallery / SubGallery using GroupBy and Flexible Height 

    It's been a while so I don't remember the specifics, but here's my notes from the video:

    •  Provides a table of data grouped into a header table of OrderHeaderID
    •  Items = GroupBy(Table1,"OrderHeaderID","grpOrderDetail")
    •  Inner Gallery Items = ThisItem.grpOrderDetail
    •  Use Flexible Height Gallery.
    • Set child gallery Height =  CountA(grpOrderDetail.OrderHeaderID)*60 + 20  -- for group gap
    Essentially it is counting the elements of the inner group and multiplying the count by the row height  (60 in my case), and then adding 20 for spacing between groups.

    Hope this helps!

    ------------------------------
    Steve Bolton
    Sr. Business Analyst
    ------------------------------