如何能使连接在鼠标移动到单元格的时候就实现onhover的效果,或者是连接所在的行的时候

解决方案 »

  1.   

    我这个是DataGrid的例子。
    this.GridList.ItemDataBound += new DataGridItemEventHandler(this.GridList_ItemDataBound);                private void GridList_ItemDataBound(object sender, DataGridItemEventArgs e)
                    {
                            //如果是数据项并且是交替项
                            if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
                            {
                                    //移动时
                                    //添加自定义属性,当鼠标移过来时设置该行的背景色为"6699ff",并保存原背景色
                                    e.Item.Attributes.Add("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699ff'");
                                    //添加自定义属性,当鼠标移走时还原该行的背景色
                                    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor");                        }
                    }
      

  2.   

    老大 麻烦看看清楚 可是说是个纯html js问题