cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
indhaa
Impactful Individual
Impactful Individual

Set One Gallery Y Based on the Height of the first Gallery

Hi,

 

So I have Two Gallery in one screen. The records on the First gallery will vary. It might be one or more items.

So is there a way I can set the Second Gallery Y based on the height of the First Gallery.

 

Now there is a big space in between if only one or two items is in the First Gallery.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @indhaa ,

Please have a read of this blog of mine and check the Y setting of the second gallery. You may have to adjust that a bit to suit, but those are the elements you need.

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

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

Hi @indhaa ,

Please have a read of this blog of mine and check the Y setting of the second gallery. You may have to adjust that a bit to suit, but those are the elements you need.

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

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

BCLS776
Community Champion
Community Champion

You can alter the size/position of a gallery frame dynamically by putting a formula into the appropriate X, Y, Width,  Height properties.

 

Perhaps set the Height property to:

If(CountRows(galleryDataSource)<3,
    100*CountRows(galleryDataSource),
    300
)

This code would set the height of the gallery shorter if there are only 1 or 2 items, and max it out at 300 pixels for more items than that.

Does that fit what you are trying to do?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,105)