title: Use DataGridView to populate text boxes on the form VB .NET 2010
body: <p>I want to display (DataGridView's) selected row contents (each cell value on appropriate text box) on text boxes on the form. This should be fairly simple task for experienced i am sure.</p>
  
  <p>So far i haven't been able to find a single working solution to accomplish that as most of the articles are written for VB / VB 2005/ VB 2008 and not VB 2010.</p>
  
  <p>Any help, tips, answers is greatly appreciated,</p>
  
  <p>Regards,
  Ayub</p>
  
  <p>Here is what i have already tried. (I tried putting an image but i can't due to my privileges thanks stack over flow)</p>
  
  <pre><code>TextBox1.Text = DoctorsDataGridView.CurrentRow.Cells(0).Value.ToString
  </code></pre>
  
  <p>It strangely works for first 4 selected rows and populate text boxes but fails for the rest of the DataGridView.</p>
  
  <p>WORKING SOLUTION: </p>
  
  <pre><code> txtRoll.Text = grd.CurrentRow.Cells(0).Value.ToString
  </code></pre>
  
  <p>replace 0 - x, to match cell/column.</p>
  
  <p>when about code is put under CellClick event (i.e handles grd.CellClick), it works !</p>