C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Tips » Visual Studio »

Change the Background Row Color of the GridView control using MouseEvents


Posted Date: 27 Aug 2009    Resource Type: Tips    Category: Visual Studio
Author: Syed Shakeer Hussain Member Level: Diamond    
Rating: 1 out of 5Points: 3



In Events DoubleClik on RowDataBound.

after DoubleCliking on RowDataBound Event you will get a code in .aspx.cs as Below:

protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='Silver'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='green'");
}
}

In Above RowDataBound event add onmouseover and onmouseout Events.The Color can be set by using this.style.backgroundcolor='red'





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
MouseEvents  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Usage of using key word
Previous Resource: Add a Custom Place to a File Dialog Box
Return to Discussion Resource Index
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use