且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将空行添加到datagridview

更新时间:2023-08-17 19:06:46

如果DataGridView绑定到数据源,那么我认为你不能这样做。 使用未绑定的数据,您可以插入空行,但是对于绑定数据,您将需要空记录,这可能会使底层数据源变得混乱(如果
甚至允许,例如,您不能在其中包含任何必填字段绑定数据源)
If the DataGridView is bound to a data source then I don't think you'll be able to do this.  With unbound data you could insert empty rows, but with bound data you would need empty records and that could make a mess of the underlying data source (if it was even allowed e.g. you couldn't have any required fields in the bound data source)