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

查看:199
本文介绍了如何删除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 )到 false 为您的网路。

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

您可以从代码设置或使用视觉工作室设计师。

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

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

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