如何根据条件动态地在每行或每个行之后或之后将新行添加到数据表中 [英] How Do I Add New Row in the middle or after each row or after table Into Datatable Dynamically Depending On The Condition

查看:60
本文介绍了如何根据条件动态地在每行或每个行之后或之后将新行添加到数据表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在数据表中,根据条件,我想在中间插入新行。

Hi, In a datatable depending on the condition i want to insert new rows in middle.

推荐答案

我认为你正在寻找这种方法: DataRowCollection.InsertAt(..) [ ^ ]



Eg

I think you're looking for this method: DataRowCollection.InsertAt(..)[^]

E.g.
myDataTable.Rows.InsertAt(newRow, index);


这篇关于如何根据条件动态地在每行或每个行之后或之后将新行添加到数据表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆