How can I set background color on "DataGrid" like "DataList" alternately?

Ichiro Uozu shared this question 32 days ago
Answered

/1f97c4ad08ebd2affe34f354d431add5

Comments (2)

photo
1

We can create an "On Page Load" + "Change Style" event and change the style of the Grid_Cell. Then, for that event, we can use a condition to detect if a number in the Grid_Cell is even. If the number is even, it will change the style.

The condition uses a Regular Expression to achieve this. It should look like this:

faae2d6e02c365d81435272102421874

The text in the second space is this: ^\d*[02468]$

photo
1

Oh! It's good! I learned this technique. Thanks!