question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code that highlights a row when the user clicks on the row, but how
can i remove the hightlight of the clicked row when the user clicks on
another row?

i have this in the datagrid_itemdatabound
e.Item.Attributes.Add("onclick", "this.style.backgroundColor='yellow")
 
Mike said:
I have code that highlights a row when the user clicks on the row, but how
can i remove the hightlight of the clicked row when the user clicks on
another row?

i have this in the datagrid_itemdatabound
e.Item.Attributes.Add("onclick", "this.style.backgroundColor='yellow")

You're going to have to change the client-side onclick attribute to call
some function that does more than just set the color of the clicked row
to yellow, but also resets the colors of all the other rows in the
DataGrid back to the "non-highlighted" color.

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
Back
Top