title: How to select a row in data GridView and populate another gridview?
body: <p>This might be a repeat question but i didn't find any solution that helps me. So asking again separately. I would appreciate if anyone provide me any solutions.</p>
  
  <p>I Would like to show a data gridview and just select any of the rows of that data and another gridview would be populated using that selected row value.</p>
  
  <pre><code>     &lt;div&gt;
          &lt;table align="center" cellpadding="1" cellspacing="1" width="950px"&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;asp:GridView ID="GridView1" runat="server"&gt;&lt;/asp:GridView&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:GridView ID="GridView2" runat="server"&gt;&lt;/asp:GridView&gt;
                  &lt;/td&gt;
              &lt;/tr&gt; 
          &lt;/table&gt;
      &lt;/div&gt;
  
  Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
      GetAccounts()
  End Sub
  
  Protected Sub GetAccounts()
      Dim objCommand As SqlCommand
      Dim objAdapter As SqlDataAdapter
      Dim objDataSet As DataSet
      sqlString = "SELECT * FROM hanger"
  
      objCommand = New SqlCommand(sqlString, conn)
      objAdapter = New SqlDataAdapter(objCommand)
      objDataSet = New DataSet()
      objAdapter.Fill(objDataSet)
      GridView1.DataSource = objDataSet
      GridView1.DataBind()
  
      If conn.State = ConnectionState.Open Then : conn.Close() : End If
  End Sub
  </code></pre>