简体   繁体   English

如何在C#中的Datagridview中的两行之间添加行

[英]How to add row in between two rows in datagridview in c#

I have an application that include a 'datagridview' that use to type the contents directly. 我有一个包含“ datagridview”的应用程序,可用于直接键入内容。 It appears like a notepad. 它看起来像一个记事本。

Right now I need a solution that I want to add a row in between two already added/typed rows. 现在,我需要一个解决方案,我想在两个已经添加/键入的行之间添加一行。 Please help me to find the solution. 请帮助我找到解决方案。

You can use the DataGridView.Rows.Insert(int rowIndex, DataGridViewRow dataGridViewRow) which can insert a DataRow at particular/desired index. 您可以使用DataGridView.Rows.Insert(int rowIndex, DataGridViewRow dataGridViewRow) ,它可以在特定/所需索引处插入DataRow。

More details at MSDN MSDN上的更多详细信息

Overloads for Insert Method 插入方法的重载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM