简单试了一下,有个问题:第一次双击输入不了,再点击其他行或列后双击就可以输入了?
程序代码:
CREATE CURSOR tt (F1 C(10), F2 C(10), F3 I)
INSERT INTO tt VALUES ("ABC", "123456", 101)
INSERT INTO tt VALUES ("DEF", "654321", 202)
INSERT INTO tt VALUES ("GHI", "456123", 303)
GO TOP
of = CREATEOBJECT("form1")
of.show(1)
RETURN
DEFINE CLASS form1 as Form
ADD OBJECT grid1 as myGrid
ENDDEFINE
DEFINE CLASS myGrid as Grid
AllowCellSelection = .f.
PROCEDURE DblClick
this.AllowCellSelection = .t.
this.ReadOnly = .f.
ENDPROC
PROCEDURE AfterRowColChange(nColIndex)
IF this.RowColChange != 0
this.AllowCellSelection = .f.
ENDIF
ENDPROC
ENDDEFINE