讓gridview滑鼠滑入時row會變顏色

摘要:讓gridview滑鼠滑入時row會變顏色

 

先計算出gridview總共有幾列...

然後將列數丟進去小程式設定

 

Sub ccc(ByVal row_count As Integer)

        For i As Integer = 0 To (row_count - 1)

            GridView1.Rows(i).Attributes("onmouseover") = "this.style.backgroundColor='#CCC';"

'===游標滑入時的顏色

            GridView1.Rows(i).Attributes("onmouseout") = "this.style.backgroundColor='White';"

'===游標滑出時的顏色

        Next





 End Sub