【问题标题】:How to make combo box column selectable if ReadOnly property of the DataGridView set to true?如果 DataGridView 的 ReadOnly 属性设置为 true,如何使组合框列可选?
【发布时间】:2014-07-28 20:54:24
【问题描述】:

我有 DataGridView,它包含 4 列,其中一列是 DataGridViewComboBoxColumn。

在 DataGridView 中,我想防止用户在数据网格视图中删除、编辑、添加行, 所以我将 DdataGgridView 的 ReadOnly 属性设置为 true。

我的问题是 DataGridViewComboBoxColumn 不可选择,因为 ReadOnly 属性设置为 true。

知道如何防止用户在 DataGridView 控件中删除、编辑、添加行,但让 DataGridViewComboBoxColumn 可选择?

【问题讨论】:

  • 您可以使用 CellFormatting 事件来覆盖单元格的显示方式

标签: c# winforms datagridview datagridviewcolumn datagridcomboboxcolumn


【解决方案1】:

请阅读以下artice

关于只读,只是单元格,而不是整个 DataGrid

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多