我收到此错误:“DataGridViewComboBoxCell值无效。” 这是我的代码
DataGridViewComboBoxColumn dgvcombo = new DataGridViewComboBoxColumn();
dgvcombo.ValueType = typeof(decimal);
dgvcombo.Name = Name;
dgvcombo.DataPropertyName = colname;
dgvcombo.DataSource = dtsource;
dgvcombo.DisplayMember = DisplayMember;
dgvcombo.ValueMember = ValueMember;
dgvcombo.Visible = Visible;
dgvcombo.Width = width;
DataGridView.Columns.Add(dgvcombo);
每次为所有行生成Combobox列时,我都会收到此错误
答案 0 :(得分:0)
你可以试试这个
DataGridViewComboBoxColumn dgvcombo =
dataGridView1.Columns[0] as DataGridViewComboBoxColumn;
或者你可以试试这个 link也是