I have a gridview with a button (Template field/LinkButton) that loads another control, but I was getting a runtime error when clicking the button until I added the following:
protected void gvLoans_RowEditing(object sender, GridViewEditEventArgs e)
{
}
Why? I don’t want to allow editing. Am I missing something?
You most likely have the event handler assigned in the markup (aspx/ascx). If you remove the event handler assignment you can remove the event handler in the code behind.
Also, make sure you are not enabling the built in editing functionality which could happen if you provide a CommandButton with a CommandName of “Edit”.