.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sharon Maxwell

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Highlight a Row in a GridView

Posted By: Deco     Posted Date: September 20, 2010    Points:2   Category :C#
I want to highlight a row in a gridview when a user select or
click on that row. can any one give me the sample code to get
it done?

Author: Syed Shakeer Hussain             
Posted Date: September 20, 2010     Points: 5   

Use the below code when the user selects the Row of a Gridview

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("onclick ", "this.style.backgroundColor='green'");


Author: Narayanan             
Posted Date: July 18, 2011     Points: 20   


Regards, Lakshmi Naraayanan.S

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend