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


Top 5 Contributors of the Month
david stephan

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?

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

Hi,
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   

Hi,
http://forums.asp.net/t/1081478.aspx

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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