cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akharns
Post Patron
Post Patron

Fill color on selected row in Gallery

I know several have answered this question, but it has not solved my issue.  Maybe it's due to their being old comments.

 

When I select a row in a gallery, I expect to find a separate setting such as "selected color" that would cause that row to display differently.  All I see to the right in the settings is "color", which applies to all rows.  Some historical discussions have discussed using "Fill" and "Template Fill" properties.  From my experimentation, they do the same thing, with neither actually making the fill color of the selected row different.  I tried using IF logic in the Fill property for the gallery or the top row of the gallery (they appear to use the same value), but it does not see "ThisItem".

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @akharns 

 

Fill property will not recognize ThisItem

 

But TemplateFill property of the Gallery will

Please check again

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

8 REPLIES 8
RezaDorrani
Dual Super User
Dual Super User

Hi @akharns 

 

use templatefill proprty

 

example below

If(ThisItem.IsSelected,Red,Blue)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

I must not be in the same place as you're thinking.  As stated above, If I add a formula to the gallery's Fill or Templatefill property, "this item" is not recognized.

Hi @akharns 

 

Fill property will not recognize ThisItem

 

But TemplateFill property of the Gallery will

Please check again

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ok, Templatefill does see ThisItem, but it doesn't work.

Under the TemplateFill property on the gallery, I entered "If (ThisItem.IsSelected,(RGBA(215,213,240,1),RGBA(215, 223, 240, 1))".   There is not color change when I click on a row.  The item selection does work because the data does change in the related form I'm using for detail.

Hi @akharns 

 

Try

If (ThisItem.IsSelected,RGBA(215,213,240,1),RGBA(215, 223, 240, 1))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Perfect.  It was a paren problem then.  Thanks.

It might not recognized the "ThisItem" because you might have not selected the gallery.
You could try this way if you'd like: Select your gallery > TemplateFill > then enter this:

 

If(ThisItem.IsSelected,
Transparent,
RGBA(186,202,226,100)
)

 



craicovici317_0-1665848694288.png

 

This is curious.

I make sure to select the top "cell" of the gallery and enter the same If statement.

However, I get the message: "This formula uses scope, which is not presently supported for evaluation."

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,262)