I have a dataGridView in windows.
In the dataGridView i have a combox.
Now i populate values in this combobox,
so initially i fill values in Datatable,
SqlConnection objConn = new SqlConnection(fstrConn);
SqlDataAdapter objDA;
DataTable DTResult = new DataTable();
objDA = new SqlDataAdapter(fstrSQL, fstrConn);
objDA.Fill(DTResult);
Next in dataGridView_CellBeginEdit event i am populating values to combobox,
private void dataGridView_CellBeginEdit(object sender,DataGridViewCellCancelEventArgs e)
{
DataGridViewComboBoxCell objCbo=new DataGridViewComboBoxCell();
objCbo=(DataGridViewComboBoxCell)dataGridView.Rows[e.RowIndex].Cells[0];
for (int i = 0; i < DTResult.Rows.Count; i++)
{
objCbo.Items.Add(DTResult.Rows[i][ColumnName].ToString());
objCbo.DisplayMember = ColumnName;
objCbo.ValueMember = ColumnName;
}
}
after this when i select a value in this combobox,
i need to get the value of valuemember.
so plz help me.......
thanks n advnz..........