将空行添加到datagridview [英] Add empty row to datagridview

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

问题描述

大家好

我想添加(点击一下按钮)使用Rectangle&(包括让我们说color.red)与datagridview行之间的空行任何其他行的宽度相同

I would like to add (with a button click) empty rows between to datagridview rows using Rectangle  (with let's say color.red) with the same width of any other row

这不是真正的应用程序,但它对DGV分组有用I 希望建立

This is not the real application but it will be usefull for DGV grouping I  wish to build

当然我还要点击按钮删除这个空行

And of course I have also to delete this empty row with a button click

任何人都可以帮助我吗?

Can anybody help me ?

推荐答案

如果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)


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

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