Set default value for DataGridView ComboBox
<p>My application consist of <code>DataGridviewComboBoxColumn</code> inside <code>DataGridView</code>. The <code>ComboBoxColumn</code>s are getting filled from a database table (key, value pair). I am trying to set the default value for <code>ComboBox</code> column using <code>DefaultValuesNeeded</code> event but it is not working.</p>

<p>Following is the sample code:</p>

<pre><code>e.Row.Cells["Job"] as DataGridViewComboBoxColumn).Value ="12"
</code></pre>

<p>But it shows 12 as value , instead of 12 it suppose to show actual text of 12 value.</p>

<p>For example:</p>

<p><a href="https://i.stack.imgur.com/JcQcN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JcQcN.png" alt="enter image description here"></a></p>

<pre><code>DataGridViewComboBoxColumn dgvCbJob = new DataGridViewComboBoxColumn();
{
    dgvCbJob.HeaderText = "Job";
    hadd.Clear();
    hadd.Add("@Search", string.Empty);
    ds = ObjDAL.GetDataSetForPrc("prc_GetJobList", hadd);
    if (ds.Tables[0].Rows.Count &gt; 0)
    {
        dgvCbJob.DataSource = ds.Tables[0];
        dgvCbJob.DisplayMember = "JobName";
        dgvCbJob.ValueMember = "JobMasterId";
    }
    dgvCbJob.DisplayIndex = 0;
    dgvCbJob.Width = 100;
    dgvCbJob.Name = "Job";
}
</code></pre>