cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Auto height for label not working in gallery

Hi all -

 

I am not sure if there is a way to grow this label. I selected auto height but the textbox does not seem to grow. 

This is in a blank gallery.

I tried to follow https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/gallery-dynamic-sizing but it didn't work.

 

- is it possible to grow this label and the corresponding text box?

- can i shrink the box if the label is empty? 

 

Bunly11_0-1600921263494.png

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi@Bunly11,

I am afraid there is no direct way to achieve this currently in PowerApps.

As I mentioned before, you could consider setting the AutoHeight property of the HTMLText as "false", and then you could scroll it to view all the content within.

For the Label auto height, you could try the previous solution I provided. 

Best Regards,

Qi

View solution in original post

7 REPLIES 7
Community Support
Community Support

Hi@Bunly11

Based on the issue that you mentioned, do you want to make the Label automatically adjust the row of the Gallery?

Could you please share a bit more about the scenario, do you mean that you want to enlarge the Label to display all the text within?

Actually, the AutoHeight property was designed to estimate the content size and to adjust its height accordingly. A row within a Gallery might also be taller than you expect if it contains a control for which the AutoHeight property is set to true. 

If my understanding is correct, what you want is to change the template size of the gallery based on the data in the Label. As for that you also want to shrink the box if the label is empty, I am afraid that there is no way to achieve this in PowerApps currently.

In a word, surely you could make the Label auto high, while it is impossible to adjust the Label to shrink when it is empty.

I have a test on my side, please take a try as below.

  • Set the Label AutoHeight property: true
  • Find and copy the expression in the Y property of your needed Label
  • Put the copy result in Gallery TemplateSize property and do an addition:

 

Min(168, Self.Height - 60)+Subtitle1.Y + Subtitle1.Height + 4​

 

002.png003.png

Best Regards,

Qi

Hi @v-qiaqi-msft 

 

I tried what you suggested below but the htmltext box didn't grow. Is it because there is another datacard below it?

Should I put something in the height of the datacard?

 

Thank you

 

Bunly11_0-1601527188067.png

 

Bunly11_1-1601527379069.png

 

 

 

Hi@Bunly11,

Sorry for the late reply. I have just come back from my vocation.

Combine that with your description, I just provide a solution that makes the Label within the data card auto high rather than the HTML text box. If you want to also make the HTML text box auto high, you should add something else.

I have a test on my side, please take a try as below.

  • Set the HTMLText AutoHeight property: true
  • Find and copy the expression in the Y property of your needed HTMLText
  • Put the copy result in Gallery TemplateSize property and do an addition:

 

GalleryTemplateSizeValue+LabelYpropertyValue+HTMLTextYpropertyValue​

 

Screenshot 2020-10-08 102250.png

Best Regards,

Qi

Hi @v-qiaqi-msft 

I tried that but now the htmltextbox lost the scroll bar and I am not able to see the additional information in the box.

The datacard/gallery are not shrinking.

Bunly11_1-1602194839576.png

With autoheight off i get the scrollbar

Bunly11_4-1602195004226.png

 

This is that I put in the gallery template size

 

Bunly11_2-1602194928992.png

 

Thanks

 

Hi@Bunly11,

Could you please tell me:

  1. Do you have a ScrollableScreen?
  2. Do you copy a Gallery to the data card?

Let me make it easy for you. Actually, inserting a Gallery into a data card is not allowed while the users could copy and paste it to the data card. What you have done is a bug in PowerApps. Since you have inserted a Gallery to a data card which could cause some functions not working.

Also, the HTMLText has the height limit, the AutoHeight property will not work once the cap is exceeded.

As an alternative solution, you could consider setting the AutoHeight property of the HTMLText as "false", and then you could scroll it to view all the content within.

Hope it could help you.

Best Regards,

Qi

Hi @v-qiaqi-msft 

  1. Do you have a ScrollableScreen? yes
  2. Do you copy a Gallery to the data card? yes

This was the only way I could figure out after searching on google. I have 60+ items I want to display on a scrollable screen. 

I have currently 3 datacards with gallery inserted. Is there a better way?

 

Capture.JPG

Hi@Bunly11,

I am afraid there is no direct way to achieve this currently in PowerApps.

As I mentioned before, you could consider setting the AutoHeight property of the HTMLText as "false", and then you could scroll it to view all the content within.

For the Label auto height, you could try the previous solution I provided. 

Best Regards,

Qi

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (38,132)