title: Get dataGridView selected row value
body: <p>I have the following class and I want to get the current selected row value and set it to a textbox:</p>
  
  <pre><code>private void UpdateWines() {
              string evalStr = "(WINES::get-wine-list)";
              MultifieldValue mv = (MultifieldValue)enviroment.Eval(evalStr);
              List&lt;WineRecommendation&gt; wineRecList = new List&lt;WineRecommendation&gt;();
  
              for (int i = 0; i &lt; mv.Count; i++) {
                  FactAddressValue fv = (FactAddressValue)mv[i];
                  int certainty = (int)((FloatValue)fv.GetFactSlot("certainty"));
                  String wineName = ((StringValue)fv.GetFactSlot("value"));
                  wineRecList.Add(new WineRecommendation() { WineName = wineName, Certainty = certainty });
              }
  
              dataGridView.DataSource = wineRecList;
              //richTextBox1.Text = dataGridView1.SelectedCells[0].Value;
              richTextBox1.Text = dataGridView.CurrentCell.RowIndex.ToString();
          }
  </code></pre>
  
  <p>I used <code>richTextBox1.Text = dataGridView.CurrentCell.RowIndex.ToString();</code> to get <strong>wineName</strong> but it returns 0;</p>
  
  <p>Here's an image: <img src="https://i.stack.imgur.com/kYlo8.png" alt="enter image description here"></p>