Validate a Datagrid Edit?

Discussion in 'ASP .Net Web Controls' started by Don Hans, Dec 25, 2003.

  1. Don Hans

    Don Hans Guest

    Gents,

    Trying to use the validation controls to validate a datagrid edit.

    I have tried casting the edited cell to a temporary checkbox control, and
    then validating that control. However, the validation is not working for
    some reason, as the IsValid property is alwyas true, regardless of what &*&^
    data I use. I'm thinking that maybe the contol has to have the focus to
    validate?

    In any case, what is the best way to validate a datagrid cell edit?

    Thanks!
     
    Don Hans, Dec 25, 2003
    #1
    1. Advertising

  2. Don Hans

    Don Hans Guest

    Sorry for double post - first one gave an error ;-(
    "Don Hans" <> wrote in message
    news:1OpGb.392975$...
    > Gents,
    >
    > Trying to use the validation controls to validate a datagrid edit.
    >
    > I have tried casting the edited cell to a temporary checkbox control, and
    > then validating that control. However, the validation is not working for
    > some reason, as the IsValid property is alwyas true, regardless of what

    &*&^
    > data I use. I'm thinking that maybe the contol has to have the focus to
    > validate?
    >
    > In any case, what is the best way to validate a datagrid cell edit?
    >
    > Thanks!
    >
    >
    >
     
    Don Hans, Dec 25, 2003
    #2
    1. Advertising

  3. hi Don,
    have you placed the validator within the same editItemTemplate as the
    control it has to validate. This is the only reason I can think of right now
    as to why your validator is not firing. Surely you want to validate when in
    edit mode so place your validator within the EditItemTemplate along with the
    control its supposed to validate. Should work.
    Merry christmas ;)
    "Don Hans" <> wrote in message
    news:1OpGb.392975$...
    > Gents,
    >
    > Trying to use the validation controls to validate a datagrid edit.
    >
    > I have tried casting the edited cell to a temporary checkbox control, and
    > then validating that control. However, the validation is not working for
    > some reason, as the IsValid property is alwyas true, regardless of what

    &*&^
    > data I use. I'm thinking that maybe the contol has to have the focus to
    > validate?
    >
    > In any case, what is the best way to validate a datagrid cell edit?
    >
    > Thanks!
    >
    >
    >
     
    Alessandro Zifiglio, Dec 25, 2003
    #3
  4. Don Hans

    Don Hans Guest

    Ahhh - didnt realize it needed to be in the column with the textbox control

    Thanks very much and Happy Xmas!

    "Alessandro Zifiglio" <> wrote in
    message news:HlzGb.20503$...
    > hi Don,
    > have you placed the validator within the same editItemTemplate as the
    > control it has to validate. This is the only reason I can think of right

    now
    > as to why your validator is not firing. Surely you want to validate when

    in
    > edit mode so place your validator within the EditItemTemplate along with

    the
    > control its supposed to validate. Should work.
    > Merry christmas ;)
    > "Don Hans" <> wrote in message
    > news:1OpGb.392975$...
    > > Gents,
    > >
    > > Trying to use the validation controls to validate a datagrid edit.
    > >
    > > I have tried casting the edited cell to a temporary checkbox control,

    and
    > > then validating that control. However, the validation is not working

    for
    > > some reason, as the IsValid property is alwyas true, regardless of what

    > &*&^
    > > data I use. I'm thinking that maybe the contol has to have the focus to
    > > validate?
    > >
    > > In any case, what is the best way to validate a datagrid cell edit?
    > >
    > > Thanks!
    > >
    > >
    > >

    >
    >
     
    Don Hans, Dec 25, 2003
    #4
    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. Ante Perkovic

    How to validate a datagrid (in edit mode)?

    Ante Perkovic, Jun 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,926
    Ante Perkovic
    Jun 24, 2003
  2. San Diego Guy
    Replies:
    0
    Views:
    581
    San Diego Guy
    Aug 7, 2003
  3. Schultz
    Replies:
    3
    Views:
    595
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Feb 14, 2005
  4. Don Hans

    Use Validation control to validate datagrid edit?

    Don Hans, Dec 25, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    151
    Don Hans
    Dec 25, 2003
  5. Tamir Kamara

    Validate Datagrid in edit or add (in footer)

    Tamir Kamara, Jan 22, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    139
    Tamir Kamara
    Jan 22, 2004
Loading...

Share This Page