view raw
James Carr James Carr - 6 months ago 45
ASP.NET (C#) Question

Row to update not in Edit mode

I am currently working with a GridView embedded in a custom user control. The Command field is the default one generated by the GridView itself, and all the buttons work, save for the Update button. The RowUpdating event fires, but the row itself is not in edit mode, so any code I use to attempt to find controls within the row (i.e. the text boxes for the updated values) returns null values.

The only thing I've been able to find so far is this:

The provided "answer" seems to point at the CommandName value, but I thought the whole point of using the default generated CommandField meant that was handled.

Any help/thoughts on the issue would be appreciated.


Turns out it was just an issue with the page post-back, and when each individual user control fired its DataBind().