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
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.

Kudo Commander

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

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

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 III

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.

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.


Super User

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


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

Not applicable

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.


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?