如何实现在dataGrid框里,点击鼠标,就选中这条数据?

来源:百度知道 编辑:UC知道 时间:2024/06/03 05:53:27
如何实现在dataGrid框里,点击鼠标,就选中这条数据?
使之呈反色,从而对这条数据进行操作。

麻烦大家告知下代码

类似问题已在
http://zhidao.baidu.com/question/33702268.html
回答
相关代码可以改成
//单击事件
e.Row.Attributes.Add("onclick", evt);
//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#A9A9A9'");
//当鼠标移开时还原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");