title: How to display data from Database after selecting a row from Gridview
body: <p>I have a Databound Gridview with HyperLinkField to view the row information redirected to the next page. The columns displayed in the Gridview is only a small part in my Database and i want the whole Database data including those not shown on the GridView to be displayed onto the next page.</p>
  
  <p>I have tried using the <code>DataNavigateUrlFields</code> but this will only display records that are in the GridView.</p>
  
  <p>Here are some parts of my code</p>
  
  <pre><code>&lt;asp:GridView ID="gvStock" CssClass="GV" runat="server" enablepagingandcallbackz="false" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" OnSorting="OnSorting" OnPageIndexChanging="OnPageIndexChanging"  PageSize="20" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" ForeColor="Black"&gt;
      &lt;Columns&gt;
          &lt;asp:HyperLinkField Text="View" DataNavigateUrlFields="pCode,pID,bCode,SBrand,SDescription,sCost,sPrice,SType,sSupplierName,sSupplierDirect" DataNavigateUrlFormatString="ProductDetail.aspx?pCode={0}&amp;pID={1}&amp;bCode={2}&amp;SBrand={3}&amp;SDescription={4}&amp;sCost={5}&amp;sPrice={6}&amp;SType={7}&amp;sSupplierName={8}&amp;sSupplierDirect={9}"/&gt;
          &lt;asp:BoundField DataField="pCode" HeaderText="Product Code" /&gt;
          &lt;asp:BoundField DataField="pID" HeaderText="PID"/&gt;
  &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Code behind</p>
  
  <pre><code>protected void gvStock_SelectedIndexChanged(object sender, EventArgs e)
          {
              string id = gvStock.SelectedRow.Cells[0].Text;
              Response.Redirect("ProductDetail.aspx?");
          }
  </code></pre>