cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tom_garvin
Advocate III
Advocate III

Formatting a selected Gallery item

I am trying to reverse-engineer the PDF Viewer sample app. As shown below, selection of a Gallery item makes several visual enhancements visible. Can anyone clue me in on how this is accomplished? I don't see any "OnSelect" formulas, and when I create my own gallery, I don't get these effect.

 

pdf_gallery_select_formatting.JPGpdf_gallery_select_formatting.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions

If you select the gallery, select the formula bar and you'll see the TemplateFill property there:

ForumPost001.png

View solution in original post

Thanks, I see this now.

My confusion arises because for this particular sample, highlighting of the selected gallery item was handled differently. There are several boxes and rectangles which use the formula shown below.

It was a "learning experience" for me in tracing this behavior, I would have expected visual properties to be editable on the "Properties" tab, rather than "Advanced".

But since this is dynamic behavior. "fx" makes sense. But even there, as a newbie, I failed to click "more options" and then scroll down another page or two. 

 

 

gallery_selected_item_highlights.JPG

 

 

View solution in original post

6 REPLIES 6
v-monli-msft
Community Support
Community Support

Hi @tom_garvin,

 

I don't see any PDF viewer sample app on the list.

Capture.PNG

 

Would you explain where did you get the sample app?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PDF Reader in templates for tablets.

 

Note that my question is not specific to the PDF sample, rather highlighting of a selected Gallery item.

 

This is much more important on a larger screen, where the selection list (gallery)

CarlosFigueira
Power Apps
Power Apps

You can use the 'IsSelected' property of the ThisItem operator within the gallery to know when the element is selected.

 

For example, in the app you mentioned, I imagine the formulas look somewhat like the ones below:

Gallery1.TemplateFill: If(ThisItem.IsSelected, Color.LightBlue, Color.White)
TitleLabel.FontWeight: If(ThisItem.IsSelected, FontWeight.Bold, FontWeight.Normal)
AuthorLabel.FontWeight: If(ThisItem.IsSelected, FontWeight.Bold, FontWeight.Normal)

Sounds like a clue, but where does this "Gallery1.TemplateFill" formula reside?

 

I have looked, in vain, at a dozen possible locations.

 

Please bear in mind, I'm transitioning from 20+ years of writing event-driven VBA code. In that scenario, I respond to the event. 

 

In this scenario, the formula is lurking somewhere and takes effect, almost like magic, but only if you know the trick.

 

 

If you select the gallery, select the formula bar and you'll see the TemplateFill property there:

ForumPost001.png

View solution in original post

Thanks, I see this now.

My confusion arises because for this particular sample, highlighting of the selected gallery item was handled differently. There are several boxes and rectangles which use the formula shown below.

It was a "learning experience" for me in tracing this behavior, I would have expected visual properties to be editable on the "Properties" tab, rather than "Advanced".

But since this is dynamic behavior. "fx" makes sense. But even there, as a newbie, I failed to click "more options" and then scroll down another page or two. 

 

 

gallery_selected_item_highlights.JPG

 

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (79,953)