Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Winform 应用程序中有一个 datagridview。当我单击添加按钮时,我希望在 datagridview 的底部插入一个空白行。
我试过这个:
dataGridView1.Rows.Add(row);
但空白行插入顶部而不是底部。有没有办法把它插入底部?
你可以使用Insert方法:
Insert
dataGridView1.Rows.Insert(dataGridView1.Rows.Count-1, row);