DataGridView只读属性 [英] DataGridView Read-only property

查看:112
本文介绍了DataGridView只读属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在DataGridView中有5列.我需要将第一列属性设置为只读,其余的将允许用户进行更改.我尝试了以下代码,但不起作用.请帮助

I have 5 columns in a DataGridView. I need to set the first columns property to Read Only and the rest will allow the user to make changes. I tried the following code but doesnt work. Help please

this.dgvTester2.Columns[0].ReadOnly = ReadOnlyAttribute.Yes.IsReadOnly;

this.dgvTester2.Columns[0].ReadOnly = true;

推荐答案


dgvTester2.Columns [0] .ReadOnly = true;
dgvTester2.Columns [1] .ReadOnly = true;

dgvTester2.Columns[0].ReadOnly = true;
dgvTester2.Columns[1].ReadOnly = true;



这篇关于DataGridView只读属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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