在gridview的现有行之间添加新行 [英] Adding a new row in between existing rows of gridview

查看:99
本文介绍了在gridview的现有行之间添加新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在现有行之间的datagridview上添加新行





我尝试过:



i试图编辑网格视图的数据源(数据表)。但是没有工作

解决方案

< blockquote>我希望我理解正确...



有界数据网格视图中的行顺序取决于其数据源。因此,如果您想在有界数据网格视图中添加行,请使用: DataRowCollection.InsertAt(DataRow,Int32)Method(System.Data)| Microsoft Docs [ ^ ]



对于未显示的数据网格视图,请使用:DataGridViewRowCollection.Insert方法(System.Windows.Forms) )| Microsoft Docs [ ^ ]


Adding a new row on datagridview in between existing rows



What I have tried:

i have tried to edit datasource(datatable)of grid view.But not working

解决方案

I hope i understand you correctly...

The order of rows in bounded datagridview depends on its datasource. So, if you would like to add a "row" into bounded datagridview, use: DataRowCollection.InsertAt(DataRow, Int32) Method (System.Data) | Microsoft Docs[^]

For unbouded datagridview, use: DataGridViewRowCollection.Insert Method (System.Windows.Forms) | Microsoft Docs[^]


这篇关于在gridview的现有行之间添加新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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