Repeater Control and Validation in each row

G

Guest

Hello,
I am using a Repeater control to display data and also allow data editing. I
simply have text boxes in my repeater template and allow the user to make
changes as needed.. I also allow users to enter new rows. I do this by
showing them a blank row.

The question I now have is:
1) In the new row, if the user supplies data to only 2 columns out of the
three "required" columns, I want to do a validation and ask them to provide
the data.

2) However, if the user choose not to enter a new row (leaves all the text
boxes empty), I do not want to raise any validation error..

Is this possible in a repeater control..? Any help will be appreciated.

I do not want to user DataGrid and prefer to use Repeater for some other
reasons.

Thanks.
 
T

Tim_Mac

the simplest would be to have a CustomValidator and use a simple server-side
check on the new-row text boxes. in your button click event, make sure to
use this:

If(!Page.IsValid)
return;

see the SDK for examples on using a CustomValidator if you need more info on
these.

hope this helps
tim
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top