我试图以编程方式将一行插入DataGridView . 列是:
Column1组合框Column2文本框
这是我的代码 . Column1使用DataGridView的内置DataSource绑定到表 .
DataGridViewRow row = new DataGridViewRow();
DataGridViewComboBoxCell __action1 = new DataGridViewComboBoxCell();
DataGridViewTextBoxCell __site = new DataGridViewTextBoxCell();
__action.Value = 1; //1 is id.
__sitetype.Value = "google.com";
但是这给了我一个“DataGridViewComboBoxCell无效值”的错误 . 我该如何解决?
1 回答