title: Get Selected index and Selected item from DataGridViewComboBoxCell in unbound column
body: <p>I have a big problem that make me so confuse that I have a DataGridView without using binding which has DataGridViewComboBoxColumn (unbound column) and I want to get selected index or selected item in the ComBoBoxCell (my item i custom item). </p>
  
  <p>I try to cast or follow this website (<a href="http://satishjdotnet.blogspot.com/2009/05/getting-selected-value-of-combo-box-in.html" rel="nofollow">http://satishjdotnet.blogspot.com/2009/05/getting-selected-value-of-combo-box-in.html</a>) but I only recieve Error: </p>
  
  <blockquote>
    <p>"Value is not invalid"</p>
  </blockquote>
  
  <p>. So how can I solve it?
  Please help me. Thanks a lot.
  Here is my custom Item in combobox:</p>
  
  <pre><code>public class CustomItem {
      public string Text { get; set; }
      public object Value { get; set; }
      public override string ToString() {
          return Text;
      }
      public CustomItem(string text, object value) {
          this.Text = text;
          this.Value = value;
      }
  }
  </code></pre>
  
  <p>and how I add it to DataGridViewComboBoxColumn:</p>
  
  <pre><code>List&lt;CustomItem&gt; teamItem = new List&lt;CustomItem&gt;();
  teamItem.Add(new CustomItem(this._homeTeam["Name"].ToString(), Convert.ToInt32(this._homeTeam["Id"])));
  teamItem.Add(new CustomItem(this._awayTeam["Name"].ToString(), Convert.ToInt32(this._awayTeam["Id"])));
  foreach (CustomItem i in teamItem) {
      ((DataGridViewComboBoxColumn)this.dataGridViewGoalInformation.Columns["Team"]).Items.Add(i);
  }
  </code></pre>