gridview行中的鼠标悬停颜色问题 [英] mouseover color problem in gridview rows

查看:79
本文介绍了gridview行中的鼠标悬停颜色问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好专家,



面临鼠标悬停的gridview行问题。



已经是我有一个颜色为一列---单元格[0] ..



当我鼠标悬停在行上时,我想改变整行的颜色。 />


这是我的代码。



Hello experts,

am facing problem with gridview rows with mouse over.

already i have a color for one column--- cell[0]..

again when i mouseover on row , i want to change the color for complete row.

this is my code.

protected void GVUsers_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        foreach (GridViewRow item in GVLoginHistory.Rows)
        {
            item.Cells[0].BackColor = Color.FromName("#54e4b8");
        }

        if (e.Row.RowType == DataControlRowType.DataRow)
        {


            e.Row.Attributes.Add("onmouseover",
            "this.originalcolor=this.style.backgroundColor;" + " this.style.backgroundColor='#FDCB0A';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");

        }
    }







请帮助,谢谢提前。




Please help, thanks in advance.

推荐答案

请查看以下文章并回答。它会给你你想要的东西。



1. 使用JavaScript突出显示鼠标悬停时的asp.net gridview行 [ ^ ]。

2. 在MouseOver上的网格视图中突出显示特定行 [ ^ ]。
Please check the below article and answer. It will give you exactly what you want.

1. Highlight asp.net gridview rows on mouseover - out using JavaScript [^].
2. highlight a particular row in a gridview on MouseOver[^].


这篇关于gridview行中的鼠标悬停颜色问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆