0

我需要帮助将按钮添加到我的DataGridView. 它不适用于我正在使用的代码(见下文)。

我收到一个错误:No best type found for implicity-typed Array

DataGridViewButtonCell btn = new DataGridViewButtonCell();
this.dataGridView1[0,100] = btn;
this.dataGridView1[0,100].Value = "Button";

我想要完成的是用一个按钮在这一行添加第二列:(但它不起作用)

dataGridView1.Rows.Add(new[] { "A:", (button goes here) , textbox1.Substring(648 , 2) })

4

1 回答 1

1

尝试这个 :

int index = DataGridView1.Rows.Add("Test1", "Test2", "Test3");
DataGridView1.Rows[index].Cells[2] = New DataGridViewButtonCell(){ Value = DataGridView1.Rows[0].Cells[2].Value}
于 2019-05-17T18:51:09.443 回答