关于datagrid鼠标悬停行数突出显示

private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
  {
   if(e.Item.ItemIndex!=-1)     //鼠标在DataGrid中移动时,选中的那一行显示颜色  
   {  
    e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor);this.style.backgroundColor='#99cfff'");  
    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");  
   
   }  


  }

posted @ 2007-08-01 16:53  骚包猪  阅读(342)  评论(0)    收藏  举报