WebDBGrid displays stale/incorrect rows after Delete followed by an Edit/Post cycle on TXDataWebDataSet (TMS WEB Core 3.0.1.2)

Environment:

  • TMS WEB Core version: 3.0.1.2
  • Components: TWebDBGrid, TXDataWebDataSet, TWebDataSource
  • Backend: TMS XData + MySQL (FireDAC)

Description of the issue:

After deleting a record from a TXDataWebDataSet (via Locate + Edit + Delete + ApplyUpdates), followed by a reload of the dataset (Close/Load) and then further updates to the remaining records (via Locate + Edit + Post + ApplyUpdates in a loop), the bound TWebDBGrid displays incorrect rows:

  • The deleted record is still displayed in the grid.
  • A different, unrelated record that should not have been affected is missing from the grid.

I have verified via the browser's DevTools (Network tab) that the server returns the correct data in the GET response after the deletion (the deleted record is not included, all remaining records are correct). The issue is therefore isolated to client-side rendering in TWebDBGrid — not to the underlying data.

A full page reload (F5) immediately displays the correct data.

The following has been tried without effect:

  • Calling Grid.DataSource := nil; Grid.DataSource := DS; after the reload.
  • Calling DataSource.DataSet := nil; DataSource.DataSet := Dataset; after the reload.
  • Delaying the re-render with a TWebTimer (waited several minutes without the UI correcting itself).
  • Eliminating a second, chained Close/Load cycle (tested with only a single reload cycle).

Minimal repro steps (generic, without app-specific code):

  1. Create a form with a TXDataWebDataSet (bound to any entity set with at least 4-5 rows), a TWebDataSource, and a TWebDBGrid bound to the data source.
  2. Load the dataset (Load).
  3. Delete a row in the middle of the list: Locate on key → EditDeleteApplyUpdates.
  4. In AfterApplyUpdates, call Close; in AfterClose, call Load again (same QueryString).
  5. In AfterOpen, loop through all remaining rows (First/Next) and collect their keys and one field value in memory (without modifying the dataset).
  6. Loop again: for each collected key, LocateEdit → set a field to a newly computed value → Post.
  7. Call ApplyUpdates again.
  8. Observe the grid immediately after step 7, without reloading the page: does it still show the deleted row, and is it missing another row that should not have been affected?

Question for TMS:
Is this a known behavior/regression in 3.0.1.2 related to how TWebDBGrid handles row indexing after a Delete followed by multiple Edit/Post operations on the same dataset within a short time frame? Is there a recommended method to force a fully correct re-render of the grid in this scenario (beyond the methods already tried above)?

  1. I retested this here with a DBGrid connected to a dataset and deleting a record from the dataset, but I could not see an issue. The correct record is correctly removed from the DBGrid.
  2. Did you inspect the dataset itself, i.e. try to loop through the dataset to see that effectively the record is removed from the XDataWebDataSet
  3. If you see the records in the XDataWebDataSet are correct, try to use
DBGrid.BeginUpdate;
// delete record here
DBGrid.EndUpdate;

to see if this helps