Upvote 1

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

Answered Ichiro Uozu 5 years ago

/1f97c4ad08ebd2affe34f354d431add5

Replies (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!

Leave a Comment
 
Attach a file