Avatar of Puns
Puns

asked on 

Color gridview cell thru javascript

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.
ASP.NET

Avatar of undefined
Last Comment
Puns
ASKER CERTIFIED SOLUTION
Avatar of DotNetThinker
DotNetThinker
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Puns
Puns

ASKER

Thanks you DotNetThinker!
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo