简体   繁体   中英

Adding a new row in between the two rows of the datagridview c#

Datagridview显示

what i am trying a do is that if the user clicks for example a button placed in the "random" row then a new row appears at run time in between the "random" and the "string" in the [stringtext] column..the user can add only the "stringtext" and after adding the row each datagridview row is increased by one row..any ideas?

PPUTDG.Rows.Insert(rowIndex, count);

可能是您要找的东西吗?

To insert the row :

dataGrid.Rows.Insert(indexWhereToInsertTheRow, values, toPopulate, theRow);  

To make it appear at runtime :

dataGrid.Refresh();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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