用javascript取消gridview选中状态
1 //取消编辑时,还原为原来的样式
2 var GridView2 = document.getElementById("<%=gvUser.ClientID %>");
3 for(i = 1;i < GridView2.rows.length; i++)
4 {
5 if(i%2 ==0)
6 {
7 GridView2.rows[i].style.backgroundColor='#e6f1f7';
8 }
9 else
10 {
11 GridView2.rows[i].style.backgroundColor= "White";
12 }
13 }
2 var GridView2 = document.getElementById("<%=gvUser.ClientID %>");
3 for(i = 1;i < GridView2.rows.length; i++)
4 {
5 if(i%2 ==0)
6 {
7 GridView2.rows[i].style.backgroundColor='#e6f1f7';
8 }
9 else
10 {
11 GridView2.rows[i].style.backgroundColor= "White";
12 }
13 }