title: Get the SelectedItem of DataGridViewComboBoxCell VB.NET
body: <p>Very good afternoon to all,
  The problem I have now is that I can not get the value selected as a combobox, I'm trying to set the text and value to each item in the combobox of each cell in the datagrid.
  My Code:</p>
  
  <p>CLASS MyListItem:</p>
  
  <pre><code>Public Class MyListItem
      Private mText As String
      Private mValue As String
  
      Public Sub New(ByVal pText As String, ByVal pValue As String)
          mText = pText
          mValue = pValue
      End Sub
  
      Public ReadOnly Property Text() As String
          Get
              Return mText
          End Get
      End Property
  
      Public ReadOnly Property Value() As String
          Get
              Return mValue
          End Get
      End Property
  
      Public Overrides Function ToString() As String
          Return mText
      End Function
  End Class
  </code></pre>
  
  <p>Form Load:</p>
  
  <pre><code>DataGridView1.Rows.Add()
  Dim dgvcbc As DataGridViewComboBoxCell = DirectCast(DataGridView1.Rows(0).Cells(0), DataGridViewComboBoxCell)
  dgvcbc.Items.Add(New MyListItem("Text to be displayed", "value of the item"))
  </code></pre>
  
  <p>Try to Display Selected value:</p>
  
  <pre><code>Dim oItem As MyListItem = CType(**dgvcbc.SelectedItem**, MyListItem)
  MessageBox.Show("The Value of the Item selected is: " &amp; oItem.Value)
  </code></pre>
  
  <p><strong>ERROR:</strong> 'SelectedItem' is not a member of 'System.Windows.Forms.DataGridViewComboBoxCell'</p>
  
  <p>If anyone has any idea how to set the values ​​and text to each item of each cell with combobox, I'd be very grateful thanks</p>