Stop datagrid causing validation

Discussion in 'ASP .Net Web Controls' started by Geoff Murley, Apr 12, 2005.

  1. Geoff Murley

    Geoff Murley Guest

    I have a Datagrid with the first Column as Edit. Clicking
    on Edit displays the usual Update and Cancel
    Links/Buttons. However, after I click on Edit and then
    change my data, when I click on Update the Link/Button
    Causes Validation on 2 Empty Text boxes further down the
    page which are used only for adding a new Row. So how do
    I prevent the Update Link/Button from Causing Validation
    and firing the Required Field Validators on the textboxes?
     
    Geoff Murley, Apr 12, 2005
    #1
    1. Advertising

  2. Geoff Murley

    Brock Allen Guest

    You'll have to build your own TemplateColumn and add in those Edit/Cancel/Update
    buttons yourself. On the Buttons add the CausesValidation=false property.
    For the Buttons to work with the DataGrid you'll need to set their CommandName="Edit",
    CommandName="Cancel" and CommandName="Update" so the grid knows that they
    were clicked.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I have a Datagrid with the first Column as Edit. Clicking on Edit
    > displays the usual Update and Cancel Links/Buttons. However, after I
    > click on Edit and then change my data, when I click on Update the
    > Link/Button Causes Validation on 2 Empty Text boxes further down the
    > page which are used only for adding a new Row. So how do I prevent
    > the Update Link/Button from Causing Validation and firing the Required
    > Field Validators on the textboxes?
    >
     
    Brock Allen, Apr 12, 2005
    #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. Matt Theule

    Stop Debugging doesn't stop in ASP.NET

    Matt Theule, Jul 23, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    751
    Matt Theule
    Jul 24, 2003
  2. =?Utf-8?B?RGF2aWQgQ29sbGl2ZXI=?=

    Update button in datagrid causing validation elsewhere on page

    =?Utf-8?B?RGF2aWQgQ29sbGl2ZXI=?=, May 24, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,086
    =?Utf-8?B?RGF2aWQgQ29sbGl2ZXI=?=
    May 25, 2005
  3. Replies:
    0
    Views:
    881
  4. Tina

    DataGrid Buttons causing validation

    Tina, Nov 18, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    113
  5. Joe90

    Datagrid Update Button causing unwanted validation

    Joe90, Aug 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    161
    Joe90
    Aug 2, 2005
Loading...

Share This Page