This is a migrated thread and some comments may be shown as answers.

Gridview Validation

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abdul Kadar
Top achievements
Rank 1
Abdul Kadar asked on 25 May 2010, 03:55 PM
Hi,
I have required field validator in a form to save the data.It works fine. In the same form, I have a radgrid,when I edit and click the update button in radgrid, it doesn't allow me to update the data.How can I set causeValidation property to false for radgrid.Pls help me in this issue.

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 25 May 2010, 06:23 PM
HI Abdul,

To disable validation for the grid buttons, an example would be the below code block. If you're looking to disable only a specific button, attach your code for a more specific solution.

protected void grid_ItemCreated(object sender, GridItemEventArgs e) 
    if (!(e.Item is GridCommandItem)) 
    { 
        return
    } 
 
    foreach (var control in e.Item.Controls) 
    { 
        IButtonControl button = control as IButtonControl; 
 
        if (button == null
        { 
            continue
        } 
 
        button.CausesValidation = false
    } 

Best Regards,
Kevin

Kevin Hillinger
Hillinger Studios
Tags
Grid
Asked by
Abdul Kadar
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Share this question
or