Can CompareValidator be used to compare cells in a gridview?

B

bogdan

Is it possible to have a CompareValidator to compare values from two cells
in a gridview row? I'd like to do that while in edit mode.
Thanks,
Bogdan
 
T

Teemu Keiski

You'd need to have controls such as TextBoxes in the <EditItemTemplate> with
explicit ID as you need to assign the IDs to the validator so that it knows
which controls to compare/validate. And the validator must also exist in the
template, otherwise it cannot "see" the validated controls as they'd be in
different naming container. But that way it basically is possible.
 
B

Bogdan

Thanks for the reply.

Do the controls to be validated have to be within the same
<EditItemTemplate>? If yes, then this would mean that they would have to
belong to the same gridview column, correct? So, I can't really have a
comparevalidator to span columns, can I?

Thanks,
Bogdan
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top