Tuesday, September 25, 2012


To Change GridView's Row color on mouseover :
Just put the following code snippet in GridView's RowDataBound event :

                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    e.Row.Attributes.Add("onmouseover", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='yellow';this.style.cursor='hand';");
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalstyle;");                                
                }



Download Demo Website from here

Cheers :-)

1 comments:

Anonymous said...

Works Great! Thank you very much!

Post a Comment