1

We have a Vertical Gallery inside containers, as follow:

johnjohn123_0-1697640840269.png

now each gallery's item is occupying a lot of vertical space, as follow:

johnjohn123_1-1697640980331.png

so how I can minimize this space in a dynamic way? now there are 2 settings I can change:

  1. Gallery's TemplateSize =104:

johnjohn123_2-1697641194145.png

  1. Gallery's Item Height =200 :

johnjohn123_3-1697641228772.png

so which property I need to change? and can I define dynamic formulas instead of defining hard-coded numbers inside those 2 properties?

3
  • Did you try below solution? Is it working for you? Commented Oct 21, 2023 at 13:26
  • @GaneshSanap-MVP thanks i check it, but i am trying to find a more straightforward approach instead of hardcoding the height Commented Oct 21, 2023 at 17:51
  • With the examples I gave below, it is not hardcoding the fixed height. Examples are for dynamic height based on heights of all controla inside the gallery. I don't there is any other way than this. Commented Oct 22, 2023 at 5:16

2 Answers 2

1

You have to change theTemplateSize property of Power Apps gallery control to manage the height of individual item inside the gallery.

And yes, you can define the dynamic formulas for these properties.

Example:

You have a horizontal separator control (named recSeparator) at the bottom to gallery template, you can try setting TemplateSize property to:

recSeparator.X + recSeparator.Height + 10 

If it does not work for you, you can try adding all controls inside the gallery template to formula like:

label1.X + label1.Height + 5 + recSeparator.X + recSeparator.Height + 10 

Where 5 is space between two controls.

0

Another option is to use the Flexible Height gallery. Each individual row in your gallery will automatically resize based on the content of the row.

enter image description here

For example, the template height is 220 for the image below

enter image description here

When you go to play mode you will see that the template will resize itself

enter image description here

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.