日期:2014-05-17  浏览次数:20346 次

鼠标点击GridView时,当前行用“红框”圈起来。。。
注意:不是当前行变色,当前行变色已经会了,代码如下->
C# code

        protected void gv_Visitors_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#99cc00';");
            }
        }





------解决方案--------------------
protected void gv_Visitors_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "this.style.border='2px solid red';");
}
}
------解决方案--------------------
this.style.bordercolor="FF0000"
------解决方案--------------------
e.Row.Attributes.Add("onclick", "this.style.border='1px solid red';");