No ttNotes Record Available

Posted by burnmw on 14-Jul-2011 05:44

I have an UltraGrid control, to which is bound a BindingSource. Essentially what I want to do is if a user wishes to discard changes, they would click a button which runs the REJECT-CHANGES() method against the buffer of the TempTable ttNotes.

This works well if they have only changed some data within the grid, and the grid updates itself correctly when you discard the changes. The problem occurs when the user discards a change which includes either an "Added Row" or a "Deleted Row". If they delete a row, then discard the change, I get no error, but the row doesn't reappear within the Grid, as I'd imagine it should. If the add a row, then discard the change, I get the error stated above "No ttNotes Record Available" and it appears to occuring when the Grid is re-drawing itself (maybe?).

Can anyone shed any light on my problem? I've spent ages trying to solve it, including performing the REJECT-CHANGES() method against the actual dataset rather than just the buffer.

Just to add, after I have performed the REJECT-CHANGES() method I perform a RefreshAll() on the binding source (and have also tried doing this on the Grid as well).

Many thanks in advance!

All Replies

Posted by Peter Judge on 14-Jul-2011 07:56

One thing to always bear in mind is that the ProBindingSource works against a (PRESELECT) query rather than against a buffer. So this means that if you remove any rows, you need to tell the query that they are no longer there, either by removing the rows (DELETE-RESULT-LIST-ENTRY) or by reopening the query.

-- peter

Posted by Tim Kuehn on 15-Jul-2011 12:43

A preselect query generates a result list, which is then associated with a buffer as the program steps through it. Adding or removing records in that result list w/out telling the query to add/remove the corresponding record is what causes problems.

This thread is closed