Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert a new row line of row into grid without append into recordsource

Status
Not open for further replies.

koklimabc

Programmer
Jun 17, 2013
49
MY
Hi all,

I've some problem to insert a new row line into record [highlight #A40000]without insert into cursor and then append into recordsource[/highlight].
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.
 
It can't be done. No matter what record source type you use, a grid can only show the data in the cursor, no more or less.

Depending on your needs, you could create a new cursor solely to populate the grid. It would contain an exact copy of the original data, plus one extra record to represent the new row.

Or, consider using a listbox instead. The main drawback of that approach is that it would be read-only: the user coulnd't use it to update the data.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top