我有一个 GridControl View ,该 View 正在填充一列作为 bool 值,以将值显示为复选框。
但是,我希望根据其他列的状态隐藏一些复选框。我尝试使用 gridView_CustomDrawCell()
事件,但找不到合适的属性。
我希望找到 visible
属性设置为 false 但似乎没有。
也许可以在填充 View 时隐藏复选框,但我想不出一个。
有谁知道这是否可能,以及如何?
非常感谢!
您可以尝试清除 Graphics
并将事件标记为已处理:
private void gridView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
{
if (ConditionIsMet())
{
e.Graphics.Clear(e.Appearance.BackColor);
e.Handled = true;
}
}
如果它不起作用,这是另一个想法:处理
CustomRowCellEdit
和
CustomRowCellEditForEditing
事件,并删除编辑器:
private void gridView_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e)
{
if (ConditionIsMet())
{
e.RepositoryItem = null;
}
}
我是一名优秀的程序员,十分优秀!