我有DataGridViewComboBoxColumn
我的datagridview
,我想linq
在运行时填充使用:
我试试这个
var line = from li in dbdata.Production_lines select li;
grdEmp.Rows.Add();
(grdEmp.Rows[count].Cells["Line"] as DataGridViewComboBoxCell).DataSource = line;
(grdEmp.Rows[count].Cells["Line"] as DataGridViewComboBoxCell).ValueMember = "L_id";
(grdEmp.Rows[count].Cells["Line"] as DataGridViewComboBoxCell).DisplayMember = "L_id";
但这没有用。那么如何将数据绑定到ComboBox
我的DataGridView