变色:
Dim ii As Integer        Dim count1 As Integer = DataGrid1.Items.Count        For ii = 0 To count1 - 1            DataGrid1.Items(ii).Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#FFFFCC'")            DataGrid1.Items(ii).Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor")        Next

解决方案 »

  1.   

    帮大米UP,我也需要这个功能....就是鼠标移到某条记录,就使这条记录变色...请问在什么事件里触发? c# code
      

  2.   

    我找到这个了http://www.csdn.net/Develop/read_article.asp?id=20770
      

  3.   

    在DataGrid1_ItemCreated时间中:
    e.Item.Attributes.Add
    ("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='#FFFFCC'");
    e.Item.Attributes.Add
    ("onmouseout","this.style.backgroundColor=currentcolor");
      

  4.   

    问:luochen(罗晨),刚刚是如何让鼠标放在某一行列上时,只有这一个单元格的背景色发生变化呢?