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/Loadcycle (tested with only a single reload cycle).
Minimal repro steps (generic, without app-specific code):
- Create a form with a
TXDataWebDataSet(bound to any entity set with at least 4-5 rows), aTWebDataSource, and aTWebDBGridbound to the data source. - Load the dataset (
Load). - Delete a row in the middle of the list:
Locateon key →Edit→Delete→ApplyUpdates. - In
AfterApplyUpdates, callClose; inAfterClose, callLoadagain (same QueryString). - In
AfterOpen, loop through all remaining rows (First/Next) and collect their keys and one field value in memory (without modifying the dataset). - Loop again: for each collected key,
Locate→Edit→ set a field to a newly computed value →Post. - Call
ApplyUpdatesagain. - 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)?