Related Posts Plugin for WordPress, Blogger...

About

Follow Us

Saturday, 7 February 2015

Introduction:
In this article we will learn how to highlight GridView's row on mouse over i.e. when you move cursor over any GridView row it will get highlighted. It also looks attractive and give your application a new attractive look.
To do this we can use CSS class. This is the easiest way to accomplish this task.

Implementation: let's take a simple example to understand the process.

Create CSS class i.e. style for gridview RowHover. Then set this class as CSS class of gridview.

  •   In the <head> tag of the asp.net design page(.aspx) write as:  
<head runat="server">   
    <style type="text/css">
        #grdEmp tr.rowHover:hover
    {
        background-color:# d8e32c;    
    }
    </style>
</head>

  • Now place a gridview data control on the design page(.aspx) and write as:
<asp:GridView ID="grdEmp" runat="server CssClass="rowHover" RowStyle-CssClass="rowHover">

</asp:GridView>

Note: You just need to call the class "rowHover" in CssClass and RowStyle-CssClass
Categories: , ,

0 comments:

Post a Comment