2013年9月25日 星期三

GridView72絕技之--滑鼠移動表格變色螢光棒



==前台==
 AllowSorting="True" AutoGenerateColumns="False" BackColor="White"       DataKeyNames="car_no" DataSourceID="SqlDataSource1" EmptyDataText="目前無資料"              Font-Size="Small" OnRowDataBound="GridView1_RowDataBound" Width="614px">


==後台==
 Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs)

        Dim i As Integer
        For i = 0 To GridView1.Rows.Count - 1
            If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#CEFF63'")
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c")
            End If
        Next    End Sub

沒有留言:

張貼留言