当前位置: 代码迷 >> VFP >> grid表怎么使符合条件的行才能编辑
  详细解决方案

grid表怎么使符合条件的行才能编辑

热度:4440   发布时间:2013-02-26 00:00:00.0
grid表如何使符合条件的行才能编辑?
RT,请教各位大虾。

------解决方案--------------------------------------------------------
探讨
引用:
引用:
RT,请教各位大虾。

不明白

就是能使grid表的某行能编辑,某行不能编辑。好像只有列有这个功能。

------解决方案--------------------------------------------------------
thisform.grid1.ReadOnly=IIF(this.ActiveRow=RECNO(),.f.,.t.)
只能修改当前行
试试
------解决方案--------------------------------------------------------
上述代码放在AfterRowColChange事件中
------解决方案--------------------------------------------------------
thisform.grid1.ReadOnly=IIF(this.ActiveRow=RECNO(),.f.,.t.)
thisform.grid1.ReadOnly=IIF(你的条件,.f.,.t.)
------解决方案--------------------------------------------------------
代码放到列的 Text1 的 when 事件中:

if 符合编辑条件
return .t.
else
return .f.
endif

或者: return 是否符合编辑条件

------解决方案--------------------------------------------------------
探讨
不行啊,比如我在GRID中有一列“状态”,值为“生效”的,这一行就不能编辑。