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

Radgrid row color on hover

2 Answers 427 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 22 Jun 2012, 01:14 PM
Hi,
     I want to show radgrid row in blue color on hover. Somebody help me out. Thanks in advance
RT

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Jun 2012, 01:22 PM
Hi Ryan,

Try setting the following CSS.

CSS:
<style type="text/css">
.RadGrid_Default  .rgHoveredRow
{
    background-color:Blue !important;
    background-image:none !important;
}
</style>

Thanks,
Shinu.
0
Andy Green
Top achievements
Rank 2
answered on 25 Jun 2012, 03:59 PM
You can also do it in the code behind:
Protected Sub rdDashboard_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rdDashboard.ItemCreated
 
    Try
        Dim drv As DataRowView = TryCast(e.Item.DataItem, DataRowView)
       
        If drv IsNot Nothing Then
            e.Item.Attributes.Add("onmouseover", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#ff7474'")
            e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalstyle;")
        End If
 
    Catch ex As Exception
 
    End Try
 
End Sub
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Andy Green
Top achievements
Rank 2
Share this question
or