web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamic gallery width
Power Apps
Unanswered

Dynamic gallery width

(0) ShareShare
ReportReport
Posted on by 33

Hello,

Need my gallery width (and the X of the buttons inside it) adjusted dynamically based on the gallery item with the longest name, to avoid names be clipped like this:

Annotation 2020-03-24 210420.jpg

Expected:

Annotation 2020-03-24 210655.jpg

The items are filtered dynamically so if the record with long name is not there, I'd expect:

Annotation 2020-03-24 214027.jpg

Any ideas?

 

Thanks,

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @JK2020 ,

    Yes you can do it - a bit of mathematics involved. your Gallery Width

    Max(Len(YourFieldName.Text))*x+y

    where x is the number of pixels a character takes up on average and y the number of pixels for the rest of your gallery width. You could also do the width of the label using the same principle without the y
    I have tested this and it works.

     

    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.

     

  • JK2020 Profile Picture
    33 on at

    Thank you, @WarrenBelz , this is what I was looking for (I think), the only problem is that now the gallery width changes depending on which gallery item I click on - was it the same in your testing? The "YourFieldName" in your formula is the label name of the gallery item, right?

  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    @JK2020 ,

    Yes it is the label name. I must admit I did not go clicking around it - just checked the formula worked.

    You are right it adjusts with the selected item.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard