468,268 Members | 1,717 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,268 developers. It's quick & easy.

Validator fires on all DataGrids

I have multiple datagrids on a page and each has a
RequiredFieldValidator in the EditItemTemplate as well as on a text
box in the FooterTemplate. The problem is, when the user hits update
in the EditTemplate or Submit on the footer, it fires all the other
validators in the other grids. Anyone have any hints on how to solve
this? And, yes, all grids have to be on one page.
Nov 17 '05 #1
3 873
This same thing came up for someone else a while ago. I don't know if my
suggestion worked out for him or not. Each required field validator has an
enabled attribute. I checked and even if the required field validator's
enabled attribute is set to "False" it still appears in the code of the
rendered page.

Using a javascript onfocus event you should be able to enable the required
field validator(s) for the datagrid being edited and set all others to
"False".

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Reyna Michlig" <za****@yahoo.com> wrote in message
news:fa*************************@posting.google.co m...
I have multiple datagrids on a page and each has a
RequiredFieldValidator in the EditItemTemplate as well as on a text
box in the FooterTemplate. The problem is, when the user hits update
in the EditTemplate or Submit on the footer, it fires all the other
validators in the other grids. Anyone have any hints on how to solve
this? And, yes, all grids have to be on one page.

Nov 17 '05 #2


Thanks so much for the quick response! Unfortunately, I'm very
Java-illiterate. Would you be able to post some code regarding this??
I'd appreciate it SO much!!! Thanks again!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
Reyna,

Now that I think about it are you using an edit button for the rows of each
grid?

If you are, you could probably get away without using javascript. In the
edit button's click event you could simple set the validators to enabled or
disabled right in the codebehind.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Reyna Michlig" <za****@yahoo.com> wrote in message
news:OA**************@TK2MSFTNGP10.phx.gbl...


Thanks so much for the quick response! Unfortunately, I'm very
Java-illiterate. Would you be able to post some code regarding this??
I'd appreciate it SO much!!! Thanks again!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mike Moore | last post: by
reply views Thread by Dave Bailey via DotNetMonster.com | last post: by
5 posts views Thread by Richard Payne | last post: by
9 posts views Thread by Alex Shirley | last post: by
8 posts views Thread by News | last post: by
3 posts views Thread by tshad | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.