Infragistics Ultragrid bound to dataset won't create chi

Posted by dcoughlan on 21-Jun-2017 15:19

Good Day!

I must be missing something, as i have a dataset with 2 levels (header, detail) that I have bound to an UltraGrid. When creating a new record in the parent band, it works great. However when I try to create a record in the child band nothing happens and all of the values I filled in disappear leaving a blank row in the grid. When I check the temp-tables, there is a new row for the parent but nothing for the child. 

To get everything set up I have:

  1. set the bindingSource to AutoUpdate and the UltraGrid is set to AllowRowAdding. 
  2. I have set the bindingSource:HANDLE = dataset ds1:HANDLE.

The child band is able to edit existing records just fine, however, it seems to fail when creating new ones. 

I haven't done anything special, and yet the parent band creates records fine ... is there something I am missing? 

All Replies

Posted by Laura Stern on 21-Jun-2017 16:39

Issues like this are usually all about needing to re-open a query.  When you create the child record it needs to be added to the result set of the relationship query.  AutoUpdate is about propagating changes from the UI back to the ABL automatically.  But it doesn't re-open the relationship query.

Posted by Laura Stern on 22-Jun-2017 06:26

Though...  when a record is added via AutoUpdate at the parent level, the BindingSource automatically adds the new record to the result set.  So you would think the same would work for the child table.  It is possible either that AutoUpdate is not supported at the child level or there is a bug in it.  Not in the office to look at the code or doc right now.

Posted by dcoughlan on 22-Jun-2017 07:40

That's what I am thinking as well ... which is why I figured I must be missing something.

I almost wonder if I need to specify a data source or something, but then again it does know how to edit existing ones.

Posted by Laura Stern on 22-Jun-2017 08:01

I don't think you're "missing" anything.  Check to see if the record actually got added to the table. e.g., assuming it's a TT, add some temporary code in a handy event handler to look for the record.  If it's there, then it means it was not added to the result set.  You could check that too.  Or just add it and I bet you'll see that it now shows up on the screen.  If it's not in the result list you will never see it.

If the record is there and not in the result set, I'd say it's a bug.  If the record isn't there at all, as I said, it's possible we don't support AutoUpdate for child tables.  But I don't think that's true,  check the doc.  In the meantime, you may have to not use AutoUpdate.  It's pretty simple anyhow.  The doc explains how to do it.  You have to respond to the AddNew (I think that's the name) event.

Posted by dcoughlan on 23-Jun-2017 08:18

After some more testing, I don't see the record being created at all in the child temp-table. The ultragrid does make a new row, but whenever you leave that row (and the after row update fires) the values disappear and nothing happens.

This thread is closed