title: I want to prevent ASP.NET GridView from reacting to the enter button
body: <p>I have an ASP.NET page with a gridview control on it with a CommandButton column with delete and select commands active.</p>
  
  <p>Pressing the enter key causes the first command button in the gridview to fire, which deletes a row. I don't want this to happen. Can I change the gridview control in a way that it does not react anymore to pressing the enter key?</p>
  
  <p>There is a textbox and button on the screen as well. They don't need to be responsive to hitting enter, but you must be able to fill in the textbox. Currently we popup a confirmation dialog to prevent accidental deletes, but we need something better than this.</p>
  
  <p>This is the markup for the gridview, as you can see it's inside an asp.net updatepanel (i forgot to mention that, sorry): (I left out most columns and the formatting)</p>
  
  <pre><code>&lt;asp:UpdatePanel ID="upContent" runat="server" UpdateMode="Conditional"&gt;
          &lt;Triggers&gt;
              &lt;asp:AsyncPostBackTrigger ControlID="btnFilter" /&gt;
              &lt;asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" /&gt;
          &lt;/Triggers&gt;
          &lt;ContentTemplate&gt;
              &lt;div id="CodeGrid" class="Grid"&gt;
                  &lt;asp:GridView   ID="dgCode" runat="server"&gt;
                      &lt;Columns&gt;
                          &lt;asp:CommandField SelectImageUrl="~/Images/Select.GIF"
                                              ShowSelectButton="True"
                                              ButtonType="Image"
                                              CancelText=""
                                              EditText=""
                                              InsertText=""
                                              NewText=""
                                              UpdateText=""
                                              DeleteImageUrl="~/Images/Delete.GIF"
                                              ShowDeleteButton="True" /&gt;
                          &lt;asp:BoundField DataField="Id"  HeaderText="ID" Visible="False" /&gt;
                      &lt;/Columns&gt;
                  &lt;/asp:GridView&gt;
              &lt;/div&gt;
          &lt;/ContentTemplate&gt;
      &lt;/asp:UpdatePanel&gt;
  </code></pre>