Radgrid row color on hover

3 posts, 0 answers
  1. Ryan
    Ryan avatar
    56 posts
    Member since:
    Apr 2012

    Posted 22 Jun 2012 Link to this post

    Hi,
         I want to show radgrid row in blue color on hover. Somebody help me out. Thanks in advance
    RT
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Jun 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 25 Jun 2012 Link to this post

    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
Back to Top