Create datagridview with combobox in the second column
<p>I am trying to create a datagridview with a combobox in the second column. </p>

<p>Currently my datagrid is bound to a datatable. The field patient is what I need to have in the combobox. </p>

<p>The code below adds the field but it is at the end of the grid and is duplicated...i.e there are 2 patient fields. </p>

<pre><code>DataTable dt = new DataTable();
DataColumn dtColumn;

dtColumn = new DataColumn("ClmDate", typeof(String));
dt.Columns.Add(dtColumn);

dtColumn = new DataColumn("Patient", typeof(Decimal));
dt.Columns.Add(dtColumn);

dtColumn = new DataColumn("ClmAmt", typeof(Decimal));
dt.Columns.Add(dtColumn);

cService cservice = new cService();

var trans = cservice.ClmView(txtNo.Text.Trim());

if (trans != null)
{
    // Add items to datatable
    foreach (var t in trans)
    {
        //save to datatable
        DataRow row = dt.NewRow();
        row["clmdate"] = t.clmdate.ToShortDateString();
        row["patient"] = t.patient;
        row["clmAmt"] = t.clmamt;

        dt.Rows.Add(row);
    } 
}

Grid_Refresh();

private void Grid_Refresh()
{
    grdTrans.DataSource = dt;    

    DataGridViewComboBoxColumn cb = new DataGridViewComboBoxColumn();
    cb.HeaderText = "Patient";
    cb.Name = "Patient";
    cb.Items.Add("Foo");
    cb.Items.Add("Bar");
    grdTrans.Columns.Add(cb);        
}
</code></pre>

<p>Below would be an image of the grid I am trying to reproduce...</p>

<p><a href="http://s13.postimage.org/aale668uf/grd.png" rel="nofollow">http://s13.postimage.org/aale668uf/grd.png</a> </p>

<p>Any help is appreciated.</p>
