James Carr James Carr - 1 year ago 92
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: https://forums.asp.net/t/1475154.aspx

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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download