如果DataGridView的ReadOnly属性设置为true,如何使组合框列为可选? [英] How to make combo box column selectable if ReadOnly property of the DataGridView set to true?

查看:93
本文介绍了如果DataGridView的ReadOnly属性设置为true,如何使组合框列为可选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have DataGridView it's contains 4 columns, one of the column is DataGridViewComboBoxColumn.

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

In DataGridView I want to prevent user to delete, edit, add rows in data grid view, so I set the ReadOnly property of the DdataGgridView to true.

我的问题是,由于ReadOnly属性设置为true,所以无法选择DataGridViewComboBoxColumn。

My problem is that DataGridViewComboBoxColumn is not selectable because ReadOnly property is set true.

任何想法如何阻止用户删除,编辑,添加DataGridView控件中的行,但使DataGridViewComboBoxColumn可选?

Any idea how can I prevent user to delete, edit, add rows in DataGridView control, but make DataGridViewComboBoxColumn selectable?

推荐答案

请阅读以下文章

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

Its about make readonly, just the cells, not the whole DataGrid

这篇关于如果DataGridView的ReadOnly属性设置为true,如何使组合框列为可选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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