I have a little example for you !!!
Anyway you need table buffering, because the pointer record (it's ok pointer record?) change but the grid restore it
With some lockscreen you can prevent the flick
Sorry for my very, very bad english :-)
the table is created with
create table test(cName c(30),cNumber1 n(13,2),cNumber2 n(13,2))
**************************************************
*-- Form: form1 (d:\keep\frmtest.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Marca de hora: 02/20/01 01:13:00 AM
*
DEFINE CLASS form1 AS form
Top = 0
Left = 0
Height = 264
Width = 375
DoCreate = .T.
Caption = "Form1"
nregini = 0
Name = "Form1"
lkeepinrecord = .F.
ADD OBJECT grid1 AS grid WITH ;
ColumnCount = 3, ;
Height = 200, ;
Left = 12, ;
RecordSource = "test", ;
Top = 12, ;
Width = 320, ;
Name = "Grid1", ;
Column1.ControlSource = "test.cname", ;
Column1.Width = 75, ;
Column1.Name = "Column1", ;
Column2.ControlSource = "test.cnumber1", ;
Column2.Width = 75, ;
Column2.Name = "Column2", ;
Column3.ControlSource = "test.cnumber2", ;
Column3.Width = 75, ;
Column3.Name = "Column3"
ADD OBJECT form1.grid1.column1.header1 AS header WITH ;
Caption = "Cname", ;
Name = "Header1"
ADD OBJECT form1.grid1.column1.text1 AS textbox WITH ;
BorderStyle = 0, ;
Margin = 0, ;
ForeColor = RGB(0,0,0), ;
BackColor = RGB(255,255,255), ;
Name = "Text1"
ADD OBJECT form1.grid1.column2.header1 AS header WITH ;
Caption = "Cnumber1", ;
Name = "Header1"
ADD OBJECT form1.grid1.column2.text1 AS textbox WITH ;
BorderStyle = 0, ;
Margin = 0, ;
ForeColor = RGB(0,0,0), ;
BackColor = RGB(255,255,255), ;
Name = "Text1"
ADD OBJECT form1.grid1.column3.header1 AS header WITH ;
Caption = "Cnumber2", ;
Name = "Header1"
ADD OBJECT form1.grid1.column3.text1 AS textbox WITH ;
BorderStyle = 0, ;
Margin = 0, ;
ForeColor = RGB(0,0,0), ;
BackColor = RGB(255,255,255), ;
Name = "Text1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 228, ;
Left = 12, ;
Height = 27, ;
Width = 84, ;
Caption = "add", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 228, ;
Left = 168, ;
Height = 27, ;
Width = 84, ;
Caption = "save", ;
Name = "Command2"
PROCEDURE grid1.BeforeRowColChange
LPARAMETERS nColIndex
thisform.nRegIni=recno()
ENDPROC
PROCEDURE grid1.AfterRowColChange
LPARAMETERS nColIndex
if thisform.nRegIni#recno() and thisform.lKeepInRecord
go thisform.nRegIni
endif
ENDPROC
PROCEDURE command1.Click
append blank
thisform.lKeepInRecord=.t.
ThisForm.Grid1.Column1.Text1.SetFocus()
ENDPROC
PROCEDURE command2.Click
*-- save register
thisform.lKeepInRecord=.f.
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************
How I can attach files to a message?