This is a migrated thread and some comments may be shown as answers.

item backColor overriding hover color

4 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam King
Top achievements
Rank 1
Adam King asked on 09 May 2013, 09:55 PM
We changed our grid to assign an item Backcolor ( e.Item.BackColor = System.Drawing.Color.Red;) and now the hover color is gone. We do this on itemDataBound.

Before this change, hovering over each row would change the background.
We still have the client settings set: EnablePostBackOnRowClick="True" EnableRowHoverStyle="True"

is there a way so the BackColor does not override the hover, we just want to see the hover color again, I believe it defaulted to light blue.

Thanks

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 May 2013, 03:53 AM
Hi,

Please try adding a CssClass for the row and add a style on hovering as follows.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        //your code
        e.Item.CssClass = "RowStyle";
    }

CSS:
<style type="text/css">
     .RowStyle:hover
     {
         background-color:#829CBF ! important;
     }  
        
    </style>

Thanks,
Princy.
0
Adam King
Top achievements
Rank 1
answered on 10 May 2013, 08:49 PM
The CssClass is working but the hover is not.
I have the hover-style code on the top of my page (there is a master page too) but it doesn't take effect.
Is there another place to put this style? or set as a property in the grid code?
0
Princy
Top achievements
Rank 2
answered on 13 May 2013, 10:38 AM
Hi,

Please try the following CSS.

CSS:
<style type="text/css">
    .rgHoveredRow
    {
        background-color: #829CBF !important;
    }
</style>

Thanks,
Princy.
0
Adam King
Top achievements
Rank 1
answered on 13 May 2013, 04:37 PM
That one works.
Tags
Grid
Asked by
Adam King
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Adam King
Top achievements
Rank 1
Share this question
or