Datagrid - cancel Validation

Discussion in 'ASP .Net Datagrid Control' started by Mikie, Oct 9, 2003.

  1. Mikie

    Mikie Guest

    My app is doing all edits in the datagrid footer. The footer has some
    columns with textboxes and validation controls that look at the
    textboxes. THe footer also has a save button and a cancel button.

    My problem is that when editing a new row in the footer all the
    textboxes start out empty. If nothing is entered and the cancel button
    is clicked (trapped for in a code behind ItemCommand event) all the
    required field validators start complaining.

    Looks like I need some sort of client side code to trap the cancel
    click event and disable the validators? I don't know how to do that.

    Also, if there is a way to code for that, is it possible to go ahead
    and raise the original cancel clicked event so that the code behind
    ItemCommand event (or some server-side sub) gets called and I can do
    some additional clean up?

    T.I.A.
    Mikie, Oct 9, 2003
    #1
    1. Advertising

  2. Mikie

    Oleg Ogurok Guest

    Set the following property and it'll work:

    MyCancelButton.CausesValidation = false

    -Oleg.

    "Mikie" <> wrote in message
    news:...
    > My app is doing all edits in the datagrid footer. The footer has some
    > columns with textboxes and validation controls that look at the
    > textboxes. THe footer also has a save button and a cancel button.
    >
    > My problem is that when editing a new row in the footer all the
    > textboxes start out empty. If nothing is entered and the cancel button
    > is clicked (trapped for in a code behind ItemCommand event) all the
    > required field validators start complaining.
    >
    > Looks like I need some sort of client side code to trap the cancel
    > click event and disable the validators? I don't know how to do that.
    >
    > Also, if there is a way to code for that, is it possible to go ahead
    > and raise the original cancel clicked event so that the code behind
    > ItemCommand event (or some server-side sub) gets called and I can do
    > some additional clean up?
    >
    > T.I.A.
    Oleg Ogurok, Oct 16, 2003
    #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. Corey Olsen

    Bypass validation on cancel

    Corey Olsen, Jun 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    647
    Jurjen de Groot
    Jun 30, 2003
  2. news.public.microsoft.com

    Cancel validation?

    news.public.microsoft.com, Jul 15, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    549
    news.public.microsoft.com
    Jul 15, 2003
  3. =?Utf-8?B?VGlt?=
    Replies:
    1
    Views:
    498
    =?Utf-8?B?SmF5c29u?=
    Jan 28, 2004
  4. moondaddy
    Replies:
    1
    Views:
    568
    Saravana [MVP]
    Apr 3, 2004
  5. MB
    Replies:
    3
    Views:
    8,695
    =?Utf-8?B?c3Jpbmk=?=
    May 13, 2004
Loading...

Share This Page