H Hari Jan 3, 2004 #1 I want to highlight a row in a ASP.NET datagrid when i click on it ? How can i do that?
P power_mj Jan 3, 2004 #2 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'"); }
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'"); }
H Hari Jan 5, 2004 #3 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
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