TDBAGrid - OnRowChanging Issue

I'm experiencing an odd behavior with the OnRowChanging event of TDBAgrid.

I'm using PageMode = true;

I'm using the OnRowChanging event to access grid data when the row is changed, but I'm experiencing a different behavior based on how the new row is selected.

If I select a new row by clicking on a row, data is correct.
If I select a new row using the cursor keys, data is incorrect.  It appears to either lead or lag the desired data depending on the direction.

In both cases, the new row value from the OnRowChanging event is showing the correct value (i.e. it is not the case that one method is reporting the wrong new row value).

Any ideas?

How do you check/inspect data, what data? Is this grid cell data? Dataset fields based data? Other?


Sorry for the missing details.

I'm using the OldRow, NewRow values passed from the event to access data in the Cells[][] and Floats[][] arrays.

I have retested this here with the DBAdvGrid\ADOEditing demo and the code

procedure TForm1.DBAdvGrid1RowChanging(Sender: TObject; OldRow, NewRow: Integer;
  var Allow: Boolean);

and I cannot see a problem.  The data is correct when changing the row with mouse or with keyboard.

v2.5.0.3 is not the latest version. v2.5.0.5 is the latest version.
We ask to always report issues against the latest version.

Before contacting support:

  • Make sure to first read the Guidelines
  • Make sure to first read the readme.txt or install.txt files in component distributions
  • Make sure to first read the manual and tips & faq sections on individual component pages
  • Make sure you have first checked with the latest version of the component(s)
  • Verify that you have the latest update packs for your development environment installed
  • Test if an issue can be reproduced in a separate simple test application

Bruno Fierens2020-03-06 10:50:50


Apologies for the lack of details on my operating/development environment.  An oversight on my part.  Currently a week past a deadline and scrambling for time.
Tested OS is both Windows 8.1 and Windows 10 (is that enough details or do you want the exact flavor and release?).
Tested Dev Environment is RAD Studio 10.2.3 - Specifically a C++ Builder project.
Database components are UniDAC latest release.

As for not testing with the lastest release, due to said deadline and the changes being implemented in the visual style, I've had to remain locked at this version to avoid the extra resources to resolve the issues being created with the new styles.  This is something I plan to discuss further with you once I have the time.  Unfornately, even copy and pasting existing controls with the newer version result in visual changes.  I have a hard requirement for the projects that the visual style remain consitent throughout the project.

As for the remainder of the "Before contacting support" items, I certainly made a good faith effort to examine all of these.  The behavior was certainly repeatable on other applications is my project group when I checked their behavior.  I'm not actively using the OnRowChanging event on those, but when added I saw the same behavior.  In general, I detest contacting support and only do it when I feel like I've exhausted all other courses.

Back the the problem,

I ran the demo project referenced and added your changes to output the test data.  It did indeed work.  I compared the properties of both grid and after some trial and error with the various properties located the issue.  Changing the DataSetType to 'dtNonSequenced' was the key to making it function correctly.  

There is a single mention of DataSetType in the provided documentation.  It mentions specifically a scrolling issue with the grid, which I have not observed. 

Can you elaborate on the functionaly of DataSetType?  In addition, is the DatasetTypeAuto related.  It is not mentioned in the documentation.

On the documentation, does the 'TMS Grid Pack' incompass all of the content from the 'TMS TDBAdvGrid Developers Guide' or do I need to search both for solutions.  The reason for asking is that both documents contain the same statement regard DataSetType.  

Royce Arnold

The use of the DataSetType property is explained here:

I cannot see that this property setting would affect the value of cells returned from the OnRowChanging event though. I would recommend to test this with the latest version.