vijay

welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Wednesday, February 1, 2012

Display onmouse over effect on gridview in asp.net


Hi..

Introduction:

To apply gridview onmouseover row style. we follow this method…

Description:

Grid view has power full data control used in asp.net Before I wrote many articles about grid view..Still we must learn lot of things to know about grid view.
Here we shall learn about to apply onmouse over style on grid view..
To apply this style we write the code on Rowdatabound event..Its main event used to do anything on gridview.In previous article I wrote about rowdatabound event..
For your reference I mention the path here……


http://www.dotnetcode.in/2011/06/rowdatabound-event-in-gridview-using.html

If you would see my previous article you must well known about load and edit grid view..
To show mouse over style you need to write the bit of code in row databound event

If e.Row.RowType = DataControlRowType.DataRow Then
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#FFFFE1';")
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#E0E0E0';")
        End If


Thanks for reading hope you liked it..

0 comments:

Post a Comment