title: GrdiView needs 1 DataKeyName for 1 Method and 2 DataKeyName for another method
body: <p>Hi I have a problem with my GridView.  I have one method where I need 2 datakeynames and then another method where I need a single datakey name.  I'm not sure how to deal with that?  Can anyone tell me what to do?  I'll post my GridView code below.  Just let me know if any other code is needed.  Thanks.</p>
  
  <pre><code>    &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" DataKeyNames="intExaminerID,sintDOLDistrictOfficeID" OnRowCommand="GridView1_RowCommand"&gt;
          &lt;Columns&gt;            
              &lt;asp:TemplateField&gt;                
                  &lt;ItemTemplate&gt;                 
                      &lt;asp:TextBox ID="txtID" Visible="false" runat="server" Text='&lt;%# Bind("intExaminerID") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              &lt;asp:TemplateField&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtDOID"  Visible="false" runat="server" Text='&lt;%# Bind("sintDOLDistrictOfficeID") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              &lt;asp:TemplateField HeaderText="First Name"&gt;                
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtFName" Visible='&lt;%# IsInEditMode %&gt;' runat="server" Text='&lt;%# Bind("vcharFirstName") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;  
              &lt;asp:TemplateField HeaderText="Last Name"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtLName" Visible='&lt;%# IsInEditMode %&gt;' runat="server" Text='&lt;%# Bind("vcharLastName") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;  
              &lt;asp:TemplateField HeaderText="Email"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtEmail" Visible='&lt;%# IsInEditMode %&gt;' runat="server" Text='&lt;%# Bind("vcharEmailAddress") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt; 
              &lt;asp:TemplateField HeaderText="Extension"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtPhone" Visible='&lt;%# IsInEditMode %&gt;' runat="server" Text='&lt;%# Bind("vcharPhoneExtension") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
              &lt;asp:TemplateField HeaderText="SSN Block"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:TextBox ID="txtSSNStart" Visible='&lt;%# IsInEditMode %&gt;' runat="server" Text='&lt;%# Bind("vcharSSNBlockStart") %&gt;' Width="5em"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:TextBox ID="txtSSNEnd" Visible='&lt;%# IsInEditMode %&gt;' runat="server" Text='&lt;%# Bind("vcharSSNBlockEnd") %&gt;' Width="5em"&gt;&lt;/asp:TextBox&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt; 
              &lt;asp:TemplateField HeaderText="Action(s)"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" CommandArgument='&lt;%# Container.DataItemIndex %&gt;'
   /&gt;
                      &lt;%--&lt;asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="UpdateRow" /&gt;--%&gt;
                      &lt;asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" CommandArgument='&lt;%# Container.DataItemIndex %&gt;'
   /&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>