且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更改不同值的单元格颜色 - Gridview

更新时间:2022-06-03 23:04:32

可以在gridview的rowdatabound事件上进行.将前一行保留在 viewstate 或 session 中,并将其与下一行匹配.如果不匹配,请更改颜色,否则不要更改.

you can do it on the rowdatabound event of the gridview. Keep the previous row in viewstate or session and match it with the next row. If it does't match, change the color otherwise don't change.