If a TADODataSet, bound to a TcxGrid, is opened with ExecuteOptions eoAsynchFetch or eoAsynchFetchNonBlocking the grid looks and acts strange. This can manifest in different ways, seemingly randomly. If the query is opened repeatedly the behavior may change, but it is always wrong. In either case when a field goes into edit mode, the value changes to the value from the previous row, or it may be that the values shown in the non-edit-mode fields show the wrong values. Sometimes the first row in the table shows the first row in the query but can never be selected. Other times it appears to start with the second row from the query but is selectable. This problem is at least somewhat dependent on the number of rows returned, happening less frequently for or not at all for smaller queries, and always happening if the result set is larger that around 500 rows.
This is all running against SQL Server 2005.
Steps to Reproduce:
To run the attached project, you'll need to edit these values on non-visual controls on Form1 in Unit1.pas:
* Set ADOConnection1.ConnectionString to something valid for your test environment
* Set ADODataSet1.CommandText to a query that returns around 1000 rows
* Activate the data set so you can 'Create All Columns' on cxGrid1DBTableView1 on cxGrid1 and then deactivate the data set
* Build and run
* Press the 'Open Async' button repeatedly to see the various bad behaviors. See? Funny! The 'Open Normal' button always acts as expected.
Actual Results:
When an oeAsynchFetch option is specified on a bound ADO query, TcxGrid displays incorrect data and generally acts funny.
Expected Results:
The grid should work as it does when an oeAsynchFetch option is not specified.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Zaccharria,
I have tested your sample with the most recent build 23 of our components (both v5 an v6 of the ExpressQuantumGrid) and don’t see any obvious problems. To be complete, I am sending you the project's executable compiled on my machine. The dataset points to a Northwind database on a local MSSQL Server 2005 and fetches ALL rows (not only 300) of the Orders table.
Am I missing something?
In the meantime, I should mention that using separate threads (if I am not mistaken, an ADO command uses a separate thread to load data asynchronously) when working with VCL/CLX controls is not quite correct. Please refer to report DQ7728 for more details in this regard.
Thanks,
Serge
P.S. Please be so kind as to specify the EXACT version of the component when posting reports here. For now, you can simply update the report's Version field.
You can visit our version info page at http://www.devexpress.com/Support/Versions.xml to learn about the most recent versions of our products and obtain instructions on how to detect and update them.
Updated version number
Hi Zaccharria,
Thank you for the update. Please test your sample with the latest build 23. Hopefully, it will work better for you.
Thanks,
Serge
I've tried using the binary you compiled and I still get the incorrect behavior here. Possibly because the result set using the Northwind database is small, I don't see all the behaviors I described orignally, but the results are certainly not correct. I've attached screenshots that highlight the problem. As always, opening the query normally gives correct results in both the TcxGrid and the TDBGrid. Using the 'Open Async' button (ex1.jpg) however leaves the TcxGrid showing the incorrect 2nd-row values on the first row, until I go into edit mode (ex2.jpg) when that field only suddenly shows the correct value.
So I guess my ultimate question is whether this async feature is supported by Delphi and/or QuantumGrid. My primary goal is to allow the user to cancel long running queries. Also, I don’t know what DQ7728 is. Where would I find that?
I don’t know if it helps but this problem does not occur unless the query is bound to the grid while the open is in progress. If I detach, open, and then reattach everything is fine.
Hi Zaccharria,
Thank you for the clarification. I am sorry, but it seems that the ExpressQuantumGrid cannot properly work with the data loaded asynchronously because a separate thread is used. Again, please refer to report DQ7728.
"DQ7728" is the ID of the report I asked you to review. You can open it by putting this ID in the "Find Issue by ID" on the Support Center's home page or by using the direct link: http://www.devexpress.com/issue=DQ7728.
Thanks,
Serge