asp.net 1, right-click the GridView, select Properties--Events, select the RowDataBound property under Data, and double-click it.
2, under the "GridView1_RowDataBound" method to add the following code:
if (E.row.rowtype = = Datacontrolrowtype.datarow)
... {
Alternating color effects When you move the mouse to each item
E.row.attributes.add ("onmouseout", "this.style.backgroundcolor= ' white '; this.style.color= ' #003399 '");
E.row.attributes.add ("OnMouseOver", "this.style.backgroundcolor= ' #6699FF"; this.style.color= ' #8C4510 ');
}
3, save all files, run, and found the mouse in the "GridView" table within the range of movement, the background color of each row changes, the color of the text has changed.
4, this small meter is very practical, can be very eye-catching to see the record you are viewing.
5, the above information from the "Chengking (Zhengjian)" blog, thank you!