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);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…