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

[Solved] CausesValidation False for Update linkbutton when using InPlace Edit mode

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Casey
Top achievements
Rank 1
Casey asked on 23 Oct 2009, 05:34 PM
Hello,

I'm having some trouble in setting the CausesValidation property of the update button to false while in InPlace edit mode. I've tried the following, but 'update' is always null. This is in the Item_Created event and I have tried placing it in the Item_Command event when Command_Name = "Edit".

if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
        {  
            LinkButton update = (LinkButton)e.Item.FindControl("UpdateButton");  
            update.CausesValidation = false;  
        } 

Thanks,
Casey

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Oct 2009, 05:10 AM
Hello Casey,

The Edit Command is too early an event to access the elements in the edit row, since then the elements would not be rendered. Instead, you can place the same code in the ItemCreated / ItemDataBound event of the grid.

Hope this helps..
Shinu.
Tags
Grid
Asked by
Casey
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or