Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can CompareValidator be used to compare cells in a gridview?

0 views
Skip to first unread message

bogdan

unread,
May 12, 2008, 10:00:21 AM5/12/08
to
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


Teemu Keiski

unread,
May 13, 2008, 2:59:14 PM5/13/08
to
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.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"bogdan" <bog...@comany.com> wrote in message
news:ujZlKiDt...@TK2MSFTNGP06.phx.gbl...

Bogdan

unread,
May 14, 2008, 9:49:02 PM5/14/08
to
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

"Teemu Keiski" <jot...@aspalliance.com> wrote in message
news:ut2M0tSt...@TK2MSFTNGP03.phx.gbl...

0 new messages