Problem using DataGrid - Validation

  • Thread starter Shankar Mani via DotNetMonster.com
  • Start date
S

Shankar Mani via DotNetMonster.com

Hi folks,
I am facing a problem while using a DataGrid.
I have a webform with a datagrid containing two text boxes for edit viz.,
countrycode and country name. Like wise I have two more text boxes for
Adding a new row in the grid, remember these all the four text boxes are
inside the Grid.
Also I am attaching Required Field Validators to all the 4 Text Boxes.
So when I do Edit the Required Field Validators fire for the Add text boxes
also(which I donot want to do),I want only the text boxes for the edit row
should be validated by keeping the text boxes for Addition silent(i mean
without validating them).
I used the text boxes for add outside the Grid that works fine, (i used the
textbox1.enable = false;
textbox2.enable = false;
but the requirement is that the text boxes should also come inside the Data
Grid.
Can anyone come up with a solution for this.Pls help !!!
Thanking you in Advance.
Regards
Shankar.M
 
P

Peter Blum

Seems like only yesterday I answered a similar question. Here's that thread:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=128371

If you are able to disable the textboxes you don't want, you don't need the
Validation Groups mentioned in that thread. Instead, the other poster is
correct that you should disable the validators. They have a Enable property.
Set it to false when their textboxes shouldn't be validated. But if you want
both sets of textboxes to be active, you need validation groups.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top