Highlight a datagrid

  • Thread starter Thread starter Hari
  • Start date Start date
H

Hari

I want to highlight a row in a ASP.NET datagrid when i
click on it ?

How can i do that?
 
You can add some code in your ItemDataBound event,like
this:

if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType
== ListItemType.AlternatingItem){
e.Item.Attributes.Add
("onclick","this.style.backgroundColor='Silver'");
}
 
Thank you, it is working fine.
but i want the row which i clicked to be highlighted
for example if i click 1 row it should get highlighted
then if i click 2 row 1st row should be in the default
format and 2nd row should get highlighted.

How can i achieve this?

Thank you
 
Back
Top