C# DevExpress XtraGrid GridControl 帮助 - 使单元格中的复选框不可见
我有一个 GridControl 视图,其中填充了一列作为布尔值,以将值显示为复选框。
但是,我希望根据其他列的状态隐藏一些复选框。我尝试使用 gridView_CustomDrawCell()
事件,但找不到合适的属性。
我希望找到一个 visible
属性设置为 false,但似乎没有。
也许可以在填充视图时隐藏复选框,但我想不出一个。
有谁知道这是否可能,以及如何实现?
非常感谢!
I have a GridControl view which is being populated with one column as a Boolean to show the value as a checkbox.
However, I wish to hide some checkboxes based on the state of other columns. I have tried to use the gridView_CustomDrawCell()
event but cannot find a suitable property.
I expected to find a visible
property to set to false but there doesn't seem to be one.
Maybe it is possible to hide the checkbox when the view is being populated but I cannot think of one.
Does anyone know if this is possible, and how?
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试清除
Graphics
并将事件标记为已处理:如果它不起作用,这里有另一个想法:处理
CustomRowCellEdit
和CustomRowCellEditForEditing
事件,并删除编辑器:You could try to clear the
Graphics
and mark the event as handled :If it doesn't work, here's another idea : handle the
CustomRowCellEdit
andCustomRowCellEditForEditing
events, and remove the editor :我在一个项目中所做的是将 RadioGroup 设置为没有项目的控件,因此它显示为空白。
What I did for this on a project was to set a RadioGroup as the control with no items so it appeared as blank.