我在 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
我想从组合框中更改列“金钱”值
我试过这个但不知道进一步:
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);