C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to do Color Change of Row of GridView on Select & Open a New Page of Selected Row Item


Posted Date: 14 Jun 2008    Resource Type: Code Snippets    Category: ASP.NET GridView
Author: Rumpa MMember Level: Gold    
Rating: Points: 10



The following code sample shows how to do Color Change of Row of GridView on Select & Open a New Page of Selected Row Item
 
protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';this.style.backgroundColor='orangered'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");
e.Row.Attributes.Add("onclick", "window.open('test.aspx?id=" + DataBinder.Eval(e.Row.DataItem, "uid") + "','myprofilewindow','width=400,height=200,toolbar=0,resizable=0');");

}
}




Responses

Author: Kapil Dhawan    17 Jun 2008Member Level: Gold   Points : 1
Hello
Nice piece of code
Thanks for sharing your knowledge with us.
I hope to see more good code from your side
Regards,
Kapil








Author: ram    25 Jun 2008Member Level: Bronze   Points : 1
Hey help me...

when a particular row is selected.. i want the "uid" to be stored in a variable... how will i do that..?


Author: ram    25 Jun 2008Member Level: Bronze   Points : 1
Hey help me...

when a particular row is selected.. i want the "uid" to be stored in a variable... how will i do that..?


Author: ram    25 Jun 2008Member Level: Bronze   Points : 1
Hey help me...

when a particular row is selected.. i want the "uid" to be stored in a variable... how will i do that..?


Author: Bunty    27 Jun 2008Member Level: Diamond   Points : 2
Hi,

Really nice piece of code on how to change color of raow of GridView.

I want to do these changes.

Keep posting such useful code.

Thanks for sharing your knowledge.

Thanks and Regards
S.S.Bajoria



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

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: How to do Edit, Update, Delete in a GridView
Previous Resource: changing grid view row colors in two different times
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET GridView


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use