TMS WebCore iterate through webdataset

Q08.Load is an asynchronous method. After you call it, the third statement, Q08.First is immediately executed, but the dataset is not loaded yet.

You have two options:

  1. Call Load and then put the rest of your code in the AfterOpen event. That's the event executed after the asynchronous Load operation is finished.

  2. Use TXDataWebClient to retrieve data from the server directly using more flexible methods (like List). TXDataWebClient also provides you with async-flagged methods, meaning you can call them using await. There is a demo in XData installation folder (\demos\web\clientAsync) that shows how to use it. Once you get data from the client, you can put it in the dataset using SetJsonData and then you can call Open to iterate through the dataset.

But honestly, if you want to bind your data manually to a control, I don't see a need for the dataset. Just get the data from the server using TXDataWebClient, and build your grid directly using the retrieved objects.