即使只读属性设置为false,如何禁用编辑 [英] how to disable editing even when read only property is set to false

查看:136
本文介绍了即使只读属性设置为false,如何禁用编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i有一个数据网格视图到列...

i将行的只读属性设置为false ,所以当我点击它进入编辑模式的行时

我们可以输入行本身





但是我想要的是当用户点击单元格时它应该进入编辑模式,但用户不应该允许在该行中键入字母...





意味着我们不应该允许文本,进入行...

如何设置该属性?
当我们点击行时
,它应该进入编辑模式,但是当我们输入文本时,行中的文本不应该改变,意味着输入文本应该被禁用...

所以请帮我这个

hi everyone,

i have a data grid view with to columns...
i set the read only property of rows to false, so when i click on the row it enters into editing mode
and we can type in the row itself


but here i want is when user click on the cell it should get into editing mode, but user should not allow to type letters in that row...


means we should not allow text, entering in the row...
how to set that property?
when we click on row, it should enter into editing mode, but when we enter text, the text in row should not change, means entering text should be disabled...
so please help me in this

推荐答案

从用户的角度来看,这不是一个好的解决方案 - 想一想:如果你提供的设施看起来像用户可以输入那么你就会混淆并惹恼他,如果他无法实现你能做到这一点。



你可以通过处理各个Cell键盘事件来做到这一点,但是...从使用的角度看是令人讨厌的。非常讨厌。



我会让整个事情只读给自己。
That's not a good solution form a user perspective - think about it: If you provides a facility where it looks like the user can type then you are going to confuse and annoy him if he can't actually do it.

You can probably do it by handling the individual Cell keyboard events, but...nasty from a use point of view. Very nasty.

I'd make the whole thing read only myself.


这篇关于即使只读属性设置为false,如何禁用编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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