如何使选定的datagridview行的ReadOnly属性为false [英] How to make the selected datagridview row ReadOnly Property to false

查看:307
本文介绍了如何使选定的datagridview行的ReadOnly属性为false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都可以帮忙怎么做.

我要求将选定的DataGridView行的ReadOnly属性设置为false.

我尝试了以下代码:

dataGridView1.Rows [1] .Cells [0] .ReadOnly = false;

问题是完整列[0](第0列)的ReadOnly属性更改为false.

请帮助我进一步进行操作.

在此先感谢,

问候,

Aditya Kiran M.

Hi ,

Can any one please help how to do this.

I have the requirement to make the selected DataGridView Row ReadOnly Property To false.

I have tried the following code:

dataGridView1.Rows[1].Cells[0].ReadOnly = false;

The Problem is the ReadOnly Property of the Complete Column[0](0th Column) is changing to false .

Please help me how to proceed further.

Thanks in Advance,

Regards,

Aditya Kiran M.

推荐答案

尝试:
DataGridViewRow r = dataGridView1.SelectedRows[0];
if (r != null)
    {
    r.ReadOnly = false;
    }


如果您希望行ReadOnly属性为false,请使用此

if you want the row ReadOnly property to be false then use this

dataGridView1.CurrentRow.ReadOnly = false;


这篇关于如何使选定的datagridview行的ReadOnly属性为false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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