如何删除DataGridView的最后一个/页脚行? [英] How to remove the last/footer-row in DataGridView?

查看:127
本文介绍了如何删除DataGridView的最后一个/页脚行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据表,我用它作为我的datagridview的数据源:

I have a datatable which I use it as a datasource for my datagridview:

dgv.DataSource = dt;



但结合DataTable之后,我得到了如下的结果。最后一行允许人们点击该行并进入我不希望发生的数据。

but after binding the datatable I get the below result. The last row allows people to click on the row and enter data which I don't want to happen.

如何删除最后一排的运行时间(以突出图片)

How can I remove the last row in run time (highlighted in the picture)

感谢

推荐答案

这是不是数据表行,但所谓的 NEWROW C $ C> DataGridView的来删除它设置属性 AllowUserToAddRows MSDN )为为您的网格。

That is not data table row but so called NewRow of DataGridView to remove it set property AllowUserToAddRows (MSDN) to false for your gird.

您可能会导致代码或使用Visual Studio设计设置。

You may either set it from code or using visual studio designer.

这篇关于如何删除DataGridView的最后一个/页脚行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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