看到gridview有这么一段代码实现,鼠标在gridview的行上移动的时候显示高亮。
if (e.Row.RowType == DataControlRowType.DataRow)
{
//当鼠标选择某行时变颜色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00ffee';");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
e.Row.Cells[5].Text = Convert.ToDateTime(e.Row.Cells[5].Text).ToShortDateString();
}
求助我要是用listview怎么实现此功能啊,发现e.item点不出attributes属性。求助,另外,我感觉这个功能可以用javascript实现,但是不知怎么获取正行。求助。