Hi,
I just set up a datagrid table for customers' data, name, address, etc. There is a button that puts the data inputted by the user (new customer) into the Dg. I have one line of data - that is, one customer in the table. When I try to enter a second customer's details it just overwrites the first one. The lesson lost me inasmuch as it goes into editing the row template, but I don't need to edit to enhance the presentation as the table will never be seen, it will just issue the data to invoices, etc., according to a user-selected customer code. Can anyone advise me in simple terms how to enter a second, and successive rows into the dg ?
DataGrid Table; entering more rows of data
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: DataGrid Table; entering more rows of data
Hi CAsba,
Tell us and we will be able to point you to the problem.
Best
Klaus
the big question is, what did you script in that namely button?
Tell us and we will be able to point you to the problem.
Best
Klaus
Re: DataGrid Table; entering more rows of data
Hi Klaus, the code is
Code: Select all
put fld "newcode" of cd "enter new customer" & tab & fld "bizname" of cd "enter new customer" & tab & fld "line2" of cd "enter new customer" & tab & fld "line3" of cd "enter new customer" & tab & fld "line4" of cd "enter new customer" & tab & fld "line5" of cd "enter new customer" & tab & fld "line6" of cd "enter new customer" & tab & fld "line7" of cd "enter new customer" & tab & fld "line8" of cd "enter new customer" & tab & fld "line9" of cd "enter new customer" & tab & fld "line10" of cd "enter new customer" & tab & fld "line11" of cd "enter new customer" into theText
put false into firstLineContainsColumnNames
set the dgText [ firstLineContainsColumnNames ] of group "DataGrid 1" to theText
Re: DataGrid Table; entering more rows of data
AHA!
Well, setting "the dgtext of grp xyz to zxy" will overwrite the complete content of the datagrid and not only the last line!
You just want to:
Best
Klaus
Well, setting "the dgtext of grp xyz to zxy" will overwrite the complete content of the datagrid and not only the last line!
You just want to:
Code: Select all
...
put fld "newcode" of cd "enter new customer" & tab & ... into theText
dispatch "addline" to grp "DataGrid 1" with theText
...
Klaus
Re: DataGrid Table; entering more rows of data
Many thanks Klaus, worked a treat.