troubleshooting Question

Color gridview cell thru javascript

Avatar of Puns
Puns asked on
ASP.NET
2 Comments1 Solution350 ViewsLast Modified:
Hi,
.Net 2.0, C#
I have a template column with a textbox in a gridview. When the user enters a value in the textbox for a row,I validate the value and based on some calculations I have to color the back ground of the cell in which the textbox is placed. I pass the text box control to my javascript function to validate. when i use
 "txtControl.parentElement.parentElement.style.backgroundColor='#FF0000';" - this sets the color for the entire row. Is there any way to color only that particular cell in that row? (The template column is the 3rd column in the grid). Any help is greatly appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros