如何在Datagridview的最后(“假")行中隐藏按钮? [英] How to hide button in last(“fake”) row of Datagridview?

查看:82
本文介绍了如何在Datagridview的最后(“假")行中隐藏按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In my dgv I have a DataGridViewButtonColumn which adds a "delete row" button to each row. However, a button also gets created for the "fake" row at the bottom of the dgv, which makes no sense in this context because that row does not correspond to a record yet. What is a good way to hide that button, or at least paint over it?

我碰到了

I came across this page which shows a method that might do the trick, but I was wondering if there is a better way to do this for this particular situation.

推荐答案

请为数据网格设置CanUserAddRows = false和CanUserDeleteRows = false以及IsReadOnly = true.

Please set the CanUserAddRows=false and CanUserDeleteRows=false and IsReadOnly=true for the datagrid.


这篇关于如何在Datagridview的最后(“假")行中隐藏按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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