Click here to Skip to main content
15,175,959 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a winform in which I have a DataGridView.
mapped the datasource of the DataGridView from a database table. than at run time i created a DataGridViewComboBoxColumn and populate its value and added that DataGridViewComboBoxColumno column to the existing DataGridView

Now since DataGridViewComboBoxColumno is a combobox column, user can select any value from the drop down which is the part of DataGridView.

I need solution from which I am able to get the complete datatable along with the DataGridViewComboBoxColumn, user select on runtime so that i can update the same on database.

DataSet ds = new DataSet();


DataTable recordsTable = new DataTable();
recordsTable = ds.Tables[0];

dataGridView1.DataSource = recordsTable;

DataGridViewComboBoxColumn dgvCmb = new DataGridViewComboBoxColumn();
dgvCmb.HeaderText = "SET Priority";
dgvCmb.Name = "cmbName";
dgvCmb.DisplayMember = "Name";
dgvCmb.ValueMember = "self";
dgvCmb.AutoComplete = true;
dgvCmb.MaxDropDownItems = 3;
dgvCmb.FlatStyle = FlatStyle.Flat;


how i can get a datatable along with the value user select on DataGridViewComboBoxColumn.
Updated 10-Sep-13 22:20pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900