By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,494 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,494 IT Pros & Developers. It's quick & easy.

Problem using DataGrid - Validation

P: n/a
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

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Have you tried disabling or hiding the validators?

"Shankar Mani via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:fc******************************@DotNetMonste r.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

--
Message posted via http://www.dotnetmonster.com

Nov 19 '05 #2

P: n/a
Seems like only yesterday I answered a similar question. Here's that thread:
http://www.asp.net/Forums/ShowPost.a...&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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Shankar Mani via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:fc******************************@DotNetMonste r.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

--
Message posted via http://www.dotnetmonster.com

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.