#1 2018-01-31 13:20:45

Vladimir
Member
Registered: 2012-12-21
Posts: 10

TMS DBGrid doesn't show all records from TSynVirtualDataSet

Hello

I'm experimenting with the Mongo driver part of Mormot. For easy data visualization I wanted to connect a DB grid (TMS TDbAdvGrid actually) through a data set to a Mongo collection. It seems to be very simple with the TSynVirtualDataSet classes, but the problem is that the grid only shows the first record.
The connection is done like this:

var
  Docs: TVariantDynArray;
begin
  fDocsColl.FindDocs(Docs, null);
  TmsGrid.DataSet := ToDataSet(Self, Docs, [], []);
...

Now, this might not be a limitation in the mOMot code, because the standard TDBGrid works properly and shows all the records. The TMS one doesn't. The Docs array contains all the records so the query works.
However, the TMS grid so far has been working with all datasets and this is the first time I have seen this issue.

So I wonder if some methods might be needed that are not implemented in the mORMot TDataSet descendant? The TMS grid has properties for working with paged and sequential/non-sequential datasets, but they don't fix the problem.

Any ideas what the cause could be?
Thanks

Offline

#2 2018-01-31 13:49:49

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,549
Website

Re: TMS DBGrid doesn't show all records from TSynVirtualDataSet

You can try SynDBMidasVCL.ToClientDataSet

Offline

#3 2018-01-31 15:37:18

Vladimir
Member
Registered: 2012-12-21
Posts: 10

Re: TMS DBGrid doesn't show all records from TSynVirtualDataSet

Thanks, linking it with ToClientDataSet shows all the data. But what does that mean regarding the TDataSet, why it doesn't work with it?

I don't see a similar Mongo related function.
Well, I guess that I could convert the variant array to JSON and then to a TClientDataSet with JSONToClientDataSet. Its a couple of lines and it should work, but it's a lot of copying of data.

Offline

Board footer

Powered by FluxBB