Overblog Follow this blog
Edit post Administration Create my blog
Balavardhan Reddy Narani

Change the Background Row Color of the GridView control using MouseEvents without postback

August 25 2009 , Written by Balavardhan Reddy Published on #ASP.Net

Change the Background Row Color of the GridView control using MouseEvents without postback


Change BackGround Color of a Row in Gridview when user moves mouse on a particular selecting Row, without postback.

You need write the code in RowDataBound Event of Gridview,

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{

}



In this RowDataBound event add onmouseover and onmouseout Events.

if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='blue'");

e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");

}



when the user Moves Mouseover or MouseOut on Gridview the Particular selecting Row on gridview changes the BackGround Color without postback.

--

Share this post

Repost 0

Comment on this post

pallavi seth 08/20/2010 07:50



check this site also for changing grid view color http://gridviewrowcolor.blogspot.com/



speech ideas 12/03/2009 08:30



I was wandering on web for speech writing help and found your website; it was a relief because I have got all the information now.





Informative speeches





Dissertation writing 11/02/2009 10:47



Thanks a lot for sharing first of all, i am UK stuff member i recently come to your blog its excellent keep it up.


dissertation sample


 




Dissertation topics 09/26/2009 08:13



Excellent Blog every one can get lots of information for any topics from this blog nice work keep it up.


 


Dissertation help