无法隐藏DataGridView中的第一列 [英] Can't hide first column in DataGridView
问题描述
我无法隐藏DataGridView中的第一列。我不是指标题列,而是指网格中的数据绑定ID列。作为一般规则,我将ID列放在前面并隐藏它,这样我就可以始终引用列[0]中的ID列。出于某种原因,我可以通过将visible属性设置为false来隐藏任何其他列,除了第一列。
I am unable to hide the first column in a DataGridView. I am not referring to the header column but a databound ID column in the grid. As a general rule I put the ID column at the front and hide it so I can always reference the ID column in column [0]. For some reason I am able to hide any other column by setting the visible property to false except for the first column.
推荐答案
我刚准备好了发布相同的问题。 我第一次运行搜索时可以使用。 随后每一次,第一列都变得可见。
I was just getting ready to post about the same exact issue. Mine works the first time I run my search. Every subsequent time, the first column becomes visible.
希望有人能为我们阐明这一点。
Hopefully someone can shed some light on this for us.
这篇关于无法隐藏DataGridView中的第一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!