title: Why does DataGridViewComboBoxColumn display a ValueMember?
body: <p>I have a small problem. <code>DataGridViewComboBoxColumn</code> displays a value from <code>ValueMember</code> and not from <code>DisplayMember</code>. The grid works fine and when I select something from this column I see the <code>DisplayMember</code> value, but when the focus gets lost, the grid shows a <code>ValueMember</code>. I have this code combo box column:</p>
  
  <pre><code>statusCBoxColumn.DataSource = dt 'datatable with two fields StatusId and StatusText
  statusCBoxColumn.DisplayMember = "StatusText" 'is type NVarchar
  statusCBoxColumn.ValueMember = "StatusId" 'is type Int
  </code></pre>
  
  <p>Can anybody help me?</p>
  
  <hr>
  
  <p>Edit: I solved this in the following way:</p>
  
  <pre><code>Private Sub dgv_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgv.CellFormatting
    If (dgv.Columns(e.ColumnIndex).Name = "statusCBoxColumn") Then
      If e.Value &amp; "" &gt; "" Then
        Dim s1 As String = e.Value
        e.Value = GetData("Select StatusText from Status where ID = " &amp; e.Value).ToString()
      End If
    End If
  End Sub
  </code></pre>
  
  <p>But I don't think that it's the best solution...</p>