well i have made an object for datawindow in which i made columns name as name age gender etc. this table does not exist in database and during the design of datawindow object i have selected external style as dw object. so no what actually i want to do is to insert the data using script in these column. for insertinf row i simple used Datawindowcontrol.insertrow(row) in the itemchanged event of datawindow. but it just adds the row i want data to insert there... thanks in advance for yor comments...
3 Answers
1
votes
0
votes
The insertrow method only inserts a new row in a datawindow control. You would have to populate it with the data if that is your intention. Simple code example is this:
long ll_row
ll_row = dw_save.insertrow(0)
dw_save.setitem(ll_row, "name", dw_entry.getitemstring(1,"name"))
dw_save.setitem(ll_row, "gender", dw_entry.getitemstring(1, "gender))
The above assumes you have a data entry datawindow with only a single line and a second datawindow which will save the data to the database.
You should change your design somewhat since the itemchanged event is triggered each time the user goes from field to field in the datawindow control.