是由于在DataGrid的ItemDataBound事件中增加了DataGrid的一些属性造成的.
比如:e.Item.Attributes.Add("onmousemove", "if(this.rowIndex>-1){this.style.backgroundColor='#e7e7ff';}");
e.Item.Attributes.Add("onmouseout", "if(this.rowIndex>-1){this.style.backgroundColor='#ffffff';}");
上面的代码将会发生标题的所说的情况.
改为以下代码就不会发生:
e.Item.Attributes.Add("onmousemove", "this.style.backgroundColor='#EBF1F9'");
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='transparent';");