title: datagridview in c# windows forms application
body: <p>I'm working on <code>DataGridView</code> in C# <code>WindowsForms</code> application using SQL server 2005 and i added 1 column i.e "name" to my <code>DataGridView</code> and displayed it by selecting row to text box but it shows only one column i.e "Name" to text box. But i have other columns like city state, that I have not added to my <code>DataGridView</code>
  Is there any way to display all the database record by clicking on single column "Name " from <code>DataGridView</code> to <code>Textboxes</code>?</p>
  
  <p>private void <code>dataGridView1_CellClick</code>(object sender,<code>DataGridViewCellEventArgs</code> e){
              i = e.RowIndex;
              DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];</p>
  
  <pre><code>        textBox1.Text = row.Cells[0].Value.ToString();
          String str = "server=PC2-PC;database=demo;Integrated Security=true";
          SqlConnection con = new SqlConnection(str);
          con.Open();
             if (e.RowIndex != -1)
          {
              textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[Name].Value == null ? "" : dataGridView1.Rows[e.RowIndex].Cells[Name].Value.ToString();
              CallData();
          }
  
      }
  </code></pre>