controlToValidate property of compareValidator

Discussion in 'ASP .Net Web Controls' started by TS, Dec 30, 2005.

  1. TS

    TS Guest

    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
    TS, Dec 30, 2005
    #1
    1. Advertising

  2. 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" <>
    | 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: <>
    | 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
    |
    |
    |
    Steven Cheng[MSFT], Jan 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Nagy

    Custom Control needs ControlToValidate

    Steven Nagy, Mar 6, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    581
    MasterGaurav \(www.edujini-labs.com\)
    May 8, 2007
  2. Dave
    Replies:
    1
    Views:
    574
    bruce barker
    Mar 25, 2008
  3. Nathan Sokalski
    Replies:
    0
    Views:
    336
    Nathan Sokalski
    Mar 8, 2010
  4. Jeff
    Replies:
    6
    Views:
    228
    KMILO
    May 2, 2005
  5. TS
    Replies:
    7
    Views:
    251
Loading...

Share This Page