title: Want to show data for a specific row in the gridview when that row's buttonfield is clicked
body: <p>I saw some similar post to this topic but could not solve my problem. I am using access database. So this page will load the data from the database, but it will not show any data until the button for that specific row is clicked. For now it is showing all data. Here is my code please suggest me something.</p>
  
  <p></p>
  
  <pre><code>    &lt;columns&gt;
        &lt;asp:buttonfield buttontype="Button" 
          commandname="Select"
          headertext="Select Customer" 
          text="Select"/&gt;
          &lt;asp:boundfield datafield="Customer ID" readonly="true" headertext="Customer ID"/&gt;
  
              &lt;asp:TemplateField HeaderText="First Name" AccessibleHeaderText="FirstName"&gt;
               &lt;ItemTemplate&gt;
                &lt;asp:Label ID ="txtEmployeeName" runat ="server" Text='&lt;%# Eval("firstName") %&gt;'&gt;&lt;/asp:Label&gt;
               &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
      &lt;/columns&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>public partial class DisplayCustomer : System.Web.UI.Page
  {
  protected void Page_Load(object sender, EventArgs e)
  {
      DataLayer.DataConnector dat = new DataLayer.DataConnector(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Ovich\Documents\Visual Studio 2013\WebSites\WebSite3\App_Data\Customer.accdb");
      DataTable dt = dat.DataSelect("SELECT* from Customer");
      GridView1.DataSource = dt; 
      GridView1.DataBind(); 
  }
  
  public void CustomersGridView_RowCommand(Object sender, GridViewCommandEventArgs e)
  {
  
      // If multiple ButtonField column fields are used, use the
      // CommandName property to determine which button was clicked.
      if (e.CommandName == "Select")
      {
          // Convert the row index stored in the CommandArgument
          // property to an Integer.
          int index = Convert.ToInt32(e.CommandArgument);
  
          // Get the last name of the selected author from the appropriate
          // cell in the GridView control.
          GridViewRow selectedRow = GridView1.Rows[index];
      }
  }
  }
  </code></pre>