如何将新行添加到数据绑定的datagridView(绑定数据集) [英] how add new row to data bound datagridView (dataset bound)

查看:339
本文介绍了如何将新行添加到数据绑定的datagridView(绑定数据集)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有数据集的datagridView.如何添加新行并为单元格分配一些默认值?

I am using a datagridView with dataset. How do I add a new row and assign some default values to cells?

With datagridView
              .AutoGenerateColumns = False
                 .DataSource = mydataset
  End With

推荐答案

由于已绑定到DataSet,您是否尝试过向DataSet添加一行并编辑DataSet的值?
Since it is bound to a DataSet, have you tried adding a row to the DataSet and editing the values of the DataSet?


尝试将新行添加到已绑定到datagridview的数据表中.请参阅: NewRow [
Try adding a new row to the data table you have binded to your datagridview. See: NewRow[^]


这篇关于如何将新行添加到数据绑定的datagridView(绑定数据集)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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