question

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")
 
S

Scott Mitchell [MVP]

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top