Click here to Skip to main content
16,019,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to highlight grid view row when button selected in asp.net?
Posted
Updated 1-Oct-13 17:52pm
v2

GridView1.Rows[GridView1.SelectedIndex].BackColor = Color.Yellow;
 
Share this answer
 
Comments
amnk.info 2-Oct-13 2:41am    
Thank u.
amnk.info 2-Oct-13 2:47am    
it works. thanks
indrajeet jadhav 2-Oct-13 5:18am    
Welcome bro..
Hi...
Highlight gridview row when row is selected using javascript. See this link.
http://myaspsnippets.blogspot.in/2011/03/highlight-gridview-row-when-row-is.html[^]
Thank u.
 
Share this answer
 
Comments
amnk.info 2-Oct-13 2:42am    
Thanks for reply. i will try.
XML
This is what I use:

<EditRowStyle CssClass="selectedRowStyle" />

Then CSS

.selectedRowStyle td
{
    background-color: green;
}
 
Share this answer
 
GridViewRow row1 = Gridview.SelectedRow;
row1.BackColor = System.Drawing.Color.SkyBlue;
 
Share this answer
 
Comments
amnk.info 2-Oct-13 2:41am    
Thanks i will try

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900