I am using Windows form with c# language. I want to retrieve data from website. I want to fill in the empty cells in the datagridview in the line in front of the numbers of the people whose numbers I pulled from Excel. I am trying the following codes but I am getting the error “System.InvalidOperationException: 'Denetim veriye bagli oldugunda DataGridView'in satirlar koleksiyonuna satirlar program araciligiyla eklenemez”
var val1 = dataGridView1.Rows[i].Cells[1].Value.ToString();
var val2 = dataGridView1.Rows[i].Cells[2].Value.ToString();
val1 = drv.FindElement(By.Id("name")).Text;
val2 = drv.FindElement(By.Id("surname")).Text;
dataGridView1.Rows.Add(val1);
dataGridView1.Rows.Add(val2);

Sam HobbsPosted Dec 25, 2023, 7:40 PM
The error message says that the DataGridView is bound to something, correct? Therefore you cannot use
dataGridView1.Rows.Add, you need to add the data to the collection bound to the DataGridView.Mehmet FatihPosted Jan 2, 2024, 8:04 PM
Thanks for your advice Sam.