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

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,923)