04-09-2018 08:39 AM - last edited 04-09-2018 09:07 AM
Nesting a gallery with another gallery to show related data - e.g. an Order Header with multiple rows of Order Details beneath.
A key concept is the use of the GroupBy function to 'shape' your data and controlling the height of flexible height galleries so your detail rows are always visible.
watch?v=ZzQ1t2sQvj8
Hello @PaulD1,
really liked your video and way of explanation, Kudos for that.
I have a question: I've build a gallery with a nested gallery based on a collection, grouped by an attribute. Now I Want to create a detail page for the selected item. Before nesting galleries I've been using a display form, where I can select the DataSource and Item. My problem is, I don't know, what to set as values for both attributes.
I've tried something like this:
DataSource: LocalStorage.GroupName
Item: GalleryName.Selected
Nothing works and I wonder if you could help with my issue.
Again: thumps up, for your video.
Thanks @Anonymous
I usually use the following approach:
Put a button/icon on your subgallery. In the OnSelect property of the button, set it to Navigate to your detail form.
There are acutually three arguments you can specify for Navigate, the screen, transition and a Context Variable (this is optional).
Set the context variable to be the unique identifier of the selected item in your subgallery - this would be something like:
Navigate(scnViewOrderHeader, ScreenTransition.Fade, {varOrderHeaderID:ThisItem.OrderHeaderID})
Then in the Item property of your form, you can enter an expression which gets the record you want to display by using First and Filtering on the Context Variable, like this:
First(Filter('[Order].[OrderSummary]', OrderHeaderID = varOrderHeaderID))
Hope this helps!
Hi @PaulD1,
Thank you for sharing this kind of information, it is really helpful for all of us.
I have created nested gallery according to your video, everything works great only one problem i have is the overflow of items, here is screenshot. interesting thing is that if it is on first row it shows normal, it starts only starting from second row, as well not in all. so i don't know it seems maybe a bug or someting, but want to know your opinion.
Thank you in advance,
Br,
Chingiz
Hi @Yaonline
Is your gallery a multi-column layout? I haven't tested that scenario so will need to experiment...
A few things (if you have not already tried):
1. Do you get the same issue in different browsers
2. Do you get the same issue in 'Play' mode as well as in the editor?
3. Do you get the same issue on a mobile device?
Can you try increase the height multiplier in your formula for the child gallery height? I have seen sometimes that if the child gallery height is not quite large enough to fit in all items that there can be some rendering issues of the type you mentioned (e.g. looks OK until you hover mouse over the child gallery.
I'll try to create something similar and see what I get.
Please keep us updated if you find a solution or have any other info to share.
Cheers
Paul
Hi @Yaonline
I've just been experimenting with parent Flexible Height galleries containing child Multiple Column galleries. To ensure your child gallery height is set correctly (fits all rows) you can try the following formula (in the Hieght property of the Child gallery):
RoundUp(CountRows(grpMenuItemList)/3,0)*(galChildMenuItem.TemplateHeight+galChildMenuItem.TemplatePadding)+galParentMenuCategory.TemplatePadding
In this example my grouped column is grpMenuItemList. 3 is the number of columns in the child template (there is a WrapCount propery, but I don't appear to be able to read it, so you must manually set this number to match the number of columns in your layout).
The formula does the folllowing
I have seen something a little like the issue your describe when the gallery height is not set correctly.
Another thing to look out for is if there are any labels with autoheight set to true in the child gallery as I believe this can cause display issues as well in complext set ups such as yours.
Cheers
Paul
Hi @PaulD1,
Here are the answers to your questions:
1) yes, tried IE, Edge, Chrome, Firefox
2) I get only in play mode, in edit mode everything is ok (find attached screenshots)
3) I got the same issue, on powerapps app in windows 10, not mobile device, as it is planned more for the tablets or laptops
actually i tried experiment with height, made the template height more, afterwards tested with sub-gallery height to be more than template height. all of them did not worked.
by the way tested your formula, did not work either.
Strange problem, it looks like maybe it is bug...
Anyway, thanks for help, will try to setup fixed items, for main gallery...when i will have time...
Br,
CHingiz
Hi @PaulD1,
just an update to the problem, i have added another filter and it works fine for one item in main gallery (attached screenshot i play mode). i did not changed anything else. so seems like a bug.
Br,
Chingiz