datagridview with datasource and combobox

你离开我真会死。 提交于 2019-12-05 22:04:16
Derek

I think this is what you want:

DataGridViewComboBoxColumn colbox = new DataGridViewComboBoxColumn();
colbox.DataSource = products_list.ToList();
colbox.ValueMember = "Key";
colbox.DisplayMember = "Value";
dgvQuoteLines.Columns.Add( colbox );

Look at the DataGridViewComboBoxColumn class.

colBox.DataSource = products_list.Values.ToList();

?

What do you want to show up in the combobox?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!