I'm sorry if this has already been answered and I haven't found it yet.
I am using all bound TextBox controls to both the top-level and a child table of a dataset and am wanting to create a new row for both with the click event of a button. I was reading through the UpdatableDataBindingGrid sample from the Advanced GUI Programming PDF, but am sort of confused as to the order of events. I am not sure when the CreateRow event is actually getting triggered or when the actual create statements are supposed to happen. Can I create both parent and child records together and keep them synchronized with the query?
I also looked at the purchaseOrderForm.cls from the documentation samples but that one appears to just be a single table.
Does anyone know of a sample form that does this? I have a feeling that I'm missing something simple here.
Let's start the discussion by quoting the manual...
CancelCreateRow
Published when some user action cancels a create row operation in the bound .NET control (for example, pressing ESCAPE in a new empty row).
CreateRow
Published when some user action initiates a create row operation in the bound .NET control (for example, clicking in a new empty row at the bottom of a control).
But you want to run the code manually by clicking a button? And create for example Customer/Order/Orderline records in a single action?
I would like to use a button (e.g. Add ) to create the parent record and then based on the data that the user enters create the child record.
On a similar note here.
I have been sort of recreating simple maintenance screens by employing the techniques from the purchaseOrderForm sample.
The first form I created with an Infragistics UltraWinGrid and multiple TextBox controls. I use a Button to call a method in a service adapter class to add a new record to my top-level table of my dataset:
serviceAdapter:addRecord(bindingSource1:handle:get-buffer-handle('eCustomer')).
which is:
method public void addRecord(input hBuffer as handle):
define variable hQuery as handle no-undo.
define variable rRowId as rowid no-undo.
hQuery = hBuffer:query.
hBuffer:buffer-create() no-error.
rRowId = hBuffer:rowid.
hQuery:create-result-list-entry().
hQuery:reposition-to-rowid(rRowId).
end method.
I actually took this code right out of the sample.
Once this happens I see a new row created in the UltraWinGrid control and all my bound TextBox controls reflect this as well. I can then enter data into my fields and save without error.
Then I created another form using a System.Windows.Forms.DataGridView and TextBox controls. I repeat the same process with identical code, however I do not see the new record reflected in the datagrid or the text boxes. If I 'Save' I will get an empty record.
Has anyone else seen this behavior? I'm stuck without an answer.
Hi,
Im trying to do the exact same thing, did you end up figuring this out ? I am havng a similar issue, having multiple grids in the same form.
Im also having issues with the buffer-create when there are no records in the dataset.
any help greaty appreciaited
Cheers
Tim