cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AndrewCarter
Level 8

Disabled Gallery Item still selects

I have a gallery with two controls the Display Mode is acertained by a simple evaluation of a formula, there are three items in the gallery two are enabled (edit mode) and one is disabled.

Clicking these toggle visibility of Forms on the screen, one of the forms has a dropdown which gets its selected value from the current selected gallery item, so when I selected disabled item I expect the dropdown to remain the same, however it changes it's value to the disabled item.

So question is does clicking a disabled item changed the selected gallery selected item, and if so should this not be the case

1 ACCEPTED SOLUTION

Accepted Solutions
AndrewCarter
Level 8

Re: Disabled Gallery Item still selects

@yashag2255,

 

Many thanks for the reply; I only raised the query as a general question as it seems counter productive to have a Gallery selection made by selecting a disabled control.

I think I used a ContextVariable in the end to achieve what I wanted this also enabled me to exclude the disabled items.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Disabled Gallery Item still selects

Hi,

 

I tried to recreate this but was unable to - Are you sure there's no other object within your gallery (like the gallery card itself) that is enacting Select(Parent) ? Anything within that Card that uses Select(Parent) will then affect which item is selected.

 

Could you creat an App to share with us (no business data, just standalone a simple .msapp) that is able to replicate this issue?

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!
AndrewCarter
Level 8

Re: Disabled Gallery Item still selects

@iAm_ManCat,

 

I just created same super simple test app (see attached) and I am still seeing the same issue.. I managed to get around my original problem, but just curious.

 

Andrew

Super User
Super User

Re: Disabled Gallery Item still selects

Hi @AndrewCarter 

 

I carried out some test on the app shares by you, and you can modify few properties as:
 
Button: OnSelect: If(ThisItem.Enabled = true,Set(SelectedEnabled,ThisItem))
 
Text Label: "Tab selected:" & SelectedEnabled.Label
 
This way the SelectedEnabled variable will only be changed when an enabled item is selected from the gallery. If a disabled item is selected this won't change the results.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
AndrewCarter
Level 8

Re: Disabled Gallery Item still selects

@yashag2255,

 

Many thanks for the reply; I only raised the query as a general question as it seems counter productive to have a Gallery selection made by selecting a disabled control.

I think I used a ContextVariable in the end to achieve what I wanted this also enabled me to exclude the disabled items.

View solution in original post

Super User
Super User

Re: Disabled Gallery Item still selects

Ok, had another dig - I can now answer why it is doing this - I ahve attached a modified version of your App

Answer (it's the understanding and implementation):

 

In your first gallery, you are having the label below it look at Gallery.Selected.Label, but Gallery.Selected is the Selected Gallery Item, not the rectangle that you have disabled!

 

In my second gallery, I have set the OnSelect of that Gallery Item to Set(SelectedItem, ThisItem.Label), and the label below it to "Tab selected:" & SelectedItem

 

We can see that this is now working as expected, with the disabled block not setting any value, the gallery item is still being selected but the button is performing no action Smiley Happy

 




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 146 members 3,091 guests
Please welcome our newest community members: