I have tables like that in Datagridview:
Name Money
-------------
Hi 100 //here Combobox with member {10,30,80,100} to choose
Ki 30 //here Combobox with member {10,30,80,100} to choose
I want to change Column "Money" Value from combobox
I tried with this but dont know further:
DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(String));
dt.Columns.Add("Money", typeof(String));
dt.Rows.Add(new object[] { "Hi", 100});
dt.Rows.Add(new object[] { "Ki", 30});
DataGridViewComboBoxColumn column = new DataGridViewComboBoxColumn();
var list11 = new List<string>() { "10", "30", "80", "100" };
column.DataSource = list11;
column.ValueMember = "Money";
dataGridView1.Columns.Add(column);
Try this
Just use
DataPropertyName
instead ofValueMember
You were almost done.
There are only two minor issues:
Full code below:
You can replace with
You could try the following:
Or this:
I know it's late but Try this: