cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianHFASPS
Responsive Resident
Responsive Resident

Gallery OnSelect vs Icon OnSelect

I have a gallery that has an icon in it. I have an OnSelect action on the Icon and it always seems to fire properly. However I put the same action for the OnSelect for the gallery and it doesn't activate properly. It does select the item (I have labels = Gallery.Selected.Name) but doesn't do the commands. This causes weird behavior when user clicks inside the gallery item but not on the icon. Am I missing something to make this work?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@BrianHFASPS 

What you should be looking for is the OnSelect actions of all of your controls in the gallery template.

The typical way to make all this happen is to consider that the gallery template (a row) is a container (the parent) and the controls are within it.  

If you set the OnSelect action of the controls to Select(Parent) then it will select the container that the control is in (i.e. the row).  All fine...so, then on the container (the Gallery in this case), the OnSelect action will fire whenever it is selected.  And, if the child controls in the template specifically Select the Parent, then the action will happen.

 

So, basically what you are looking for should work, but if it is not, then look at the controls in the template and make sure they are set to select the parent.

 

I hope this is clear and helpful. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@BrianHFASPS 

What you should be looking for is the OnSelect actions of all of your controls in the gallery template.

The typical way to make all this happen is to consider that the gallery template (a row) is a container (the parent) and the controls are within it.  

If you set the OnSelect action of the controls to Select(Parent) then it will select the container that the control is in (i.e. the row).  All fine...so, then on the container (the Gallery in this case), the OnSelect action will fire whenever it is selected.  And, if the child controls in the template specifically Select the Parent, then the action will happen.

 

So, basically what you are looking for should work, but if it is not, then look at the controls in the template and make sure they are set to select the parent.

 

I hope this is clear and helpful. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Anonymous
Not applicable

Hi @BrianHFASPS can you review the above reply and update the thread if it was helpful?

 

Thank you,

 

@Anonymous 

Anonymous
Not applicable

FYI - I have seen similar behavior today that APPEARED to come up unexpectedly on 1 of my 4 galleries that are similar...  However...


TLDR; - SOLUTION -> Make sure you have Display Mode set to Edit for each of the underlying controls...  🙂  This was my issue as it was set to View for many of them.  does not get fired dependent on what control is clicked.  

 

This seems to have solved the problem for me...

 

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 (18,444)