cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Highlight row in gallery

I use the following code for my gallery.TemplateFill = If(ThisItem.IsSelected=true, Red, Blue)

Everything works as it should until I refresh the gallery. Then the first row is automatically highlighted even though I haven't selected it. 

 

How can I make sure that none of the rows are selected after refreshing the gallery?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi@dahlgebra,

Do you want to color the selected row when you select it?

It seems that this is designed by default. The Gallery will select the first row after reset by default.

As an alternative solution, you could create a variable to control this, please try the following workaround.

Add a Button1 and set the OnSelect property as below:

 

Reset(BrowseGallery1);Set(reset,true)

 

Set the Gallery TemplateFill property as below:

 

If(reset && ThisItem.IsSelected,Red,Blue)

 

Add another Button2 and set the OnSelect property as below:

 

Set(reset,false)

 

Note: When you reset the Gallery clicking Button1, the first row will be colored red always, you just need to click Button2 to remove this format. If you want to reselect, you could click Button1 to restart.

0820Gif3.gif

Best Regards,

Qi

View solution in original post

1 REPLY 1
Community Support
Community Support

Hi@dahlgebra,

Do you want to color the selected row when you select it?

It seems that this is designed by default. The Gallery will select the first row after reset by default.

As an alternative solution, you could create a variable to control this, please try the following workaround.

Add a Button1 and set the OnSelect property as below:

 

Reset(BrowseGallery1);Set(reset,true)

 

Set the Gallery TemplateFill property as below:

 

If(reset && ThisItem.IsSelected,Red,Blue)

 

Add another Button2 and set the OnSelect property as below:

 

Set(reset,false)

 

Note: When you reset the Gallery clicking Button1, the first row will be colored red always, you just need to click Button2 to remove this format. If you want to reselect, you could click Button1 to restart.

0820Gif3.gif

Best Regards,

Qi

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (24,296)