日期:2014-05-19  浏览次数:20855 次

vs2003 里的代码怎么变成 vs2005里的???
vs2003里的代码如下
protected   void   DataGrid1_SelectedIndexChanged(object   sender,   EventArgs   e)
        {
               
                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.ToString.Attributes.Add( "onmouseout ",   "this.style.backgroundColor=c ");
                }

        }
上面的这个事件是个鼠标移到到表格后就会变颜色的代码!可是这个是在vs2003上写的!   在vs2005上写时却出现了没有Item这个方法!
    同志们怎么该!!!学习!!

------解决方案--------------------
在Vs2005下还是使用GridView来代替DataGrid吧,很方便的。