| |

VerySource

 Forgot password?
 Register
Search
View: 729|Reply: 4

When the mouse is over the row of the gridview, the font of the row can change color. Because it is a hyperlink column,

[Copy link]

2

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-9 14:20:01
| Show all posts |Read mode
When the mouse is over the row of the gridview, the font of the row can change color. Because it is a hyperlink column, the underline must be displayed. When the mouse is away, the font color is restored and the underline is not visible.
Reply

Use magic Report

2

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 United States

 Author| Post time: 2020-1-10 20:18:02
| Show all posts
Solved it by myself!
Reply

Use magic Report

0

Threads

56

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-1-11 14:18:01
| Show all posts
The hyperlink text is like this
Or try using LinkButton instead of hyperlink text, you can set the effects you mentioned in the control properties
Reply

Use magic Report

2

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-2-16 18:30:02
| Show all posts
Only after seeing so many people posted to me, thank you, the solution is to solve the background color change, but the foreground color is still the same, help me see what is wrong with the code, this time change it and give points!
protected void gridview2_RowDataBound (object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
           
            e.Row.Attributes.Add ("OnMouseOut", "this.style.backgroundColor = 'White'; this.style.color = '# 003399'");
            e.Row.Attributes.Add ("OnMouseOver", "this.style.backgroundColor = '# 6699FF'; this.style.color = '# 8C4510'");

        }
    }
Reply

Use magic Report

0

Threads

26

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-3-2 14:45:01
| Show all posts
If the foreground color style of TABLE is specified in CSS, it seems that in the code this.style.color = 'foreground color' will not be able to change the color. My experiments have reached this conclusion, the specific reason is unknown
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list