Currently there seem to be no easy way to specific alternate row colors. I can write some formula if I have an index in the data, but it gets tricky when I need to filter the data on the UI.
Please consider providing two additional properties to the gallery control that lets you specify odd and even row colors.
Alternate colors aid in screen readability.
Here is an example on how this is even possible today:
Fill=If(Mod(Value(ThisItem.rowid),2)=0, Color.White, Color.Beige)
Sadly I have to repeat this for each cell.
I understand your use case. However, could you expand on what you mean by you have to repeat that for each cell?
As an FYI, I had done on video on this here:
Thank you for your clarifications,
Adding @FilipK to comment on roadmap.
Thanks for the video link.
In your video sample, when you search for data, does the result retain your alternate row colors as expected or you run into the issue I mentioned above? (Assuming the filter you use will filter-out most odd or even IDs)
In the video toward the end, you mentioned I can add an ordered column as an alternate. How does that work? Is that like creating an index within the App (just like ID?)
Regarding your question on "repeat for each cell":
By cell, I meant control. In my case, I have a custom gallery where each row has multiple controls. (three labels, a checkbox and a dropdown). and I was just using the Fill property on each control to color them using Mod function. In your video, you are using TemplateFill property instead. I just switched to TemplateFill and I no longer need to repeat the coloring formulae on each control's Fill property. (Thanks for the Tip)
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))
@Audrie-MSFT , maybe it's time to change status of this idea ? We really need this function, to know position of row into a gallery, whathever there is a filter, searching or not...
I agree - this is really needed. Relying on having an ID field is too restrictive - need to be able to return the row number of a item in a filtered gallery dynamically.