我正在尝试将字符串添加到另一个类的数据网格视图中。
这是我的代码:
public void AddGridViewRows(string SuccessProxy, string SuccessURL)
{
Console.WriteLine("Called AddGridViewRows");
int row = 0;
dataGridView2.Rows.Add();
row = dataGridView2.Rows.Count - 1;
dataGridView2["doneProxy", row].Value = SuccessProxy;
dataGridView2["doneStatus", row].Value = "Passed Splash";
dataGridView2["doneURL", row].Value = SuccessURL;
dataGridView2.Update();
Console.WriteLine("Successfully added to grid");
}
控制台返回两者,但数据网格视图中没有任何内容。
答案 0 :(得分:0)
您可以使用
public void AddGridViewRows(string SuccessProxy, string SuccessURL)
{
Console.WriteLine("Called AddGridViewRows");
dataGridView2.Rows.Insert(0, SuccessProxy, "Passed Splash", SuccessURL);
Console.WriteLine("Successfully added to grid");
}