使DataGrid控件在鼠标移动时有一个色标跟着移动

 

将了下代码方在"ItemDataBound"事件中.

 

if (e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)

   {

    e.Item.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='#6699ff'");

    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=c;");

posted on 2008-07-25 14:25  wbscn  阅读(348)  评论(0)    收藏  举报