controlToValidate property of compareValidator

T

TS

If i have a datagrid and have a textbox in 1 editItemTemplate column, and
the compareValidator & another textbox in a different editItemTemplate, when
the grid is in edit mode, how do i set the controlToValidate property to the
textbox in the different column so that i can validate against it's data
input?

doing it like i would if they were in the same column, i get exception says:

Unable to find control id 'txtHardDate' referenced by the 'ControlToCompare'
property of 'cvSoftLockHardDate'

What is the workaround?

thanks
 
S

Steven Cheng[MSFT]

Hi TS,

Welcome to ASPNET newsgroup.
As for the Validation control for mutiple DataGrid Column problem, we did
have this problem due to the asp.net validators validation scope
limitation. They can only validate those control in the same container so
that when apply to datagrid, multiple columns are different containers for
inner controls that prevent the vaidator controls from working
correctly....
So far for such scenario, I think DataList/Repeater or other single
Template based databound control will be the suitable one ...
Also, if you do need to do serverside validation, you can create a own
serverside control which will locate control in the container cell and
other neighbour cell and compare their values....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)






--------------------
| From: "TS" <[email protected]>
| Subject: controlToValidate property of compareValidator
| Date: Fri, 30 Dec 2005 17:03:24 -0600
| Lines: 16
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 101nat080.tea.state.tx.us 198.214.101.80
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:32149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| If i have a datagrid and have a textbox in 1 editItemTemplate column, and
| the compareValidator & another textbox in a different editItemTemplate,
when
| the grid is in edit mode, how do i set the controlToValidate property to
the
| textbox in the different column so that i can validate against it's data
| input?
|
| doing it like i would if they were in the same column, i get exception
says:
|
| Unable to find control id 'txtHardDate' referenced by the
'ControlToCompare'
| property of 'cvSoftLockHardDate'
|
| What is the workaround?
|
| thanks
|
|
|
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top