I've some problem to insert a new row line into record without insert into cursor and then append into recordsource. That said i've five record already in existing grid list but i need to add a new line into next row under grid list.
Here is my code:
vc_tmpfile = alltrim(sys(3)) + ".dbf"
create table &vc_tmpfile (text c(254))
append from C:\tmp\aaa.out type sdf
dele all for len(ALLTRIM(text)) < 15
pack
with thisform.grid_list
Do while !EOF()
if alltrim(substr(text,1,4)) == "POPL"
.columns(2).text1.value = alltrim(substr(text,6,6))--->>It shows nothing after insert
endif
skip
enddo
endwith
Appreciate thankful to someone could help.
The VFP
Grid
control displays data from itsRecordSource
, and that one is always an "alias".So the easy VFP way is simply to do an SQL
Insert Into yourAlias ...
, or use the xBaseAppend
andReplace ...
commands.In your scenario, the Grid.RecordSource probably is the temp table you created, where your code would get improved if you'd use the
Create Cursor ...
command for creating the temporary table, and by avoiding the infamous&
operator and using (name) expressions instead wherever you can