cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThePowerAppsGuy
Resolver II
Resolver II

How to unfocus selected record in gallery?

Hey everybody,

Just go a little question and it should be quite easy to answer.

 

If I click a record in the gallery, then it'll be focused.

But how to disable the focus of the record again if I click on the record of the gallery?

 

Thanks so much for helping!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ThePowerAppsGuy :

Only need to set two variables to achieve this function.I've made a test for your reference:

1\Set the Gallery's OnSelect property to :

 

Set(var,!var);Set(default,ThisItem);Reset(Gallery1) /*var and default is my variables*/

 

2\Set the Gallery's Default property to :

 

If(var,{},default)

 

37.gif

Best Regards,

Bof

View solution in original post

4 REPLIES 4
eka24
Super User III
Super User III

Can you show a screenshot

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

@eka24,

 

If I don't want a default item selected on the gallery, I can set the default property to {}.

Then the gallery has no focus by default. But if I click the gallery again, then it'll focus again. That's what I like.

 

But what I'd like to achieve is, if I click again, then the item should not be selected again (no focus).

I've tried following for the Gallery:

OnSelect              {}

OnSelect              SetFocus(Label)

 

But there's no chance to disable the selection for the Gallery.

 

Does anyone know how to achieve it?

 

Thanks so much for helping!

Hi @ThePowerAppsGuy :

Only need to set two variables to achieve this function.I've made a test for your reference:

1\Set the Gallery's OnSelect property to :

 

Set(var,!var);Set(default,ThisItem);Reset(Gallery1) /*var and default is my variables*/

 

2\Set the Gallery's Default property to :

 

If(var,{},default)

 

37.gif

Best Regards,

Bof

View solution in original post

Hey @v-bofeng-msft,

 

Thanks for your help 😀. It's working...

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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 (70,972)