cancel
Showing results for 
Search instead for 
Did you mean: 

Ability to display alternate row colors within a gallery

One cool thing is include the ability to produce alternate colors on rows within a gallery to give more life to the UI. Just an idea

Status: New
Comments
Resident Rockstar

Nice Idea. Maybe easy to achieve by adding a rownummer property to the Template of a gallery. In this way you can also do three colors or four colors, etc.

Advocate V

Say odd numbers as grey and even numbers as light blue something like that.

Anonymous
Not applicable

Till the time use this idea.

  1. Edit a gallery item row -> set the Gallery Template, Inserted Shape, or Any TextBox or Shape, to set the FILL or Colorwith: OR
  2. use "TemplateFill" of gallerytemplate 

and add:

If(Mod(Value(ThisItem.ID),2)=0, Color!Aqua, Color!AliceBlue)

 

Courtsey: @hpkeong@mr-dang@Audrie-MSFT

https://powerusers.microsoft.com/t5/General-Discussion/Useful-Features-of-PowerApps-13-Gallery-with-...

 

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Provide-properties-in-Gallery-control-to-specify...

Anonymous
Not applicable

I did one after following the steps shared above:

 

used the TemplateFill property of the gallery control

If((DateDiff(Now(),ExpirationDate) <= 3) And (DateDiff(Now(), ExpirationDate) >= 0) ,Color.Pink, (DateDiff(Now(),ExpirationDate) > 3) And (DateDiff(Now(),ExpirationDate) < 20) , RGBA(255, 255, 204,1),(DateDiff(Now(),ExpirationDate) > 20), Color.PaleTurquoise, (DateDiff(Now(), ExpirationDate) < 0), RGBA(192,192,192,1))
Advocate II

This would be a great feature to have.

 

The workaround that dhawalseth posted doesn't work when you have filtered the gallery because you're going to be missing some IDs, so instead of a nice list going 1,2,3,4,5,6 - you get something going 1,2,3,5,7.8 - which means you're not going to get alternate row colors.

Anonymous
Not applicable

Dear @seraph787,

I agree on the suggestion that RowId's don't work as we have to sort and filter. 

 

Just for a suggestion, I implemented it without "RowId's" i.e. based on "expiration date" in my case. Choose your case wisely.

 

Cheers, thank you for the feedback.

 

Helper V

The following blog post details a clever way of getting sequential row numbers.

 

http://powerappsguide.com/blog/post/generating-row-numbers

 

This could be combined with the method above for alternate shaded rows.

Frequent Visitor

Thanks. Useful thread.

Done it by using a sequential number in data and applied Mod function with 2 to determine odd/even and applied different Template fill property for odd and even by an if condition.

Thanks

Regular Visitor

Galleries need an inherent Index property to represent rows, so that we do not have to modify Collections to include an Index.  Then the gallery can have properties per Index - like font or color etc.

Resolver I

@klelsz provided a good idea. 

it has been two years, any actions or plan?