在DataGrid的OnItemBoundData事件中写入:
if( e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem )
{
e.Item.Attributes.Add( "onmouseover", "currentcolor=this.style.backgroundColor; this.style.backgroundColor='orange'" );
e.Item.Attributes.Add( "onmouseout", "this.style.backgroundColor=currentcolor" );
}