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. Advertisements

  2. Don Hans

    Don Hans Guest

    Sorry for double post - first one gave an error ;-(
     
    Don Hans, Dec 25, 2003
    #2
    1. Advertisements

  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 ;)
     
    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!
     
    Don Hans, Dec 25, 2003
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.