Add row to grid view

前端 未结 5 2437
庸人自扰
庸人自扰 2021-02-14 08:28

Is it possible to programmatically add a row to a GridView in C# ASP?

If yes, how ?

I want to add static data directly from the code, not from an array nor an da

5条回答
  •  感情败类
    2021-02-14 08:33

    dataGridView1.Columns[0].Name = "column1";
    dataGridView1.Columns[1].Name = "column2";
    
    string[] row1 = new string[] { "column1 value", "column2 value" };
    dataGridView1.Rows.Add(row1);
    

提交回复
热议问题