TMSFNCGridDatabaseAdapter blank cells

I have a dataset with 6000 records.

If I just use:



TMSFNCGridDatabaseAdapter1.Active := True;
TMSFNCGridDatabaseAdapter1.LoadAllDataAndDisconnect;


The opening of my program will become very slow.

To work around this, I use the following code:



TMSFNCGrid1.BeginUpdate;
BufDataset1.DisableControls;
try
    TMSFNCGridDatabaseAdapter1.Active := True;
    TMSFNCGridDatabaseAdapter1.LoadAllDataAndDisconnect;
finally
    BufDataset1.EnableControls;
    TMSFNCGrid1.EndUpdate;
end;


And it works, the opening is almost instantaneous.

However, when using BeginUpdate / EndUpdate, most cells in the grid are not loaded.




I'm using Lazarus 2.0.6 r62129.

Hi,


LoadAllDataAndDisconnect allows you to sort, group and filter on the data. This is meant for smaller datasets. The reason why you don't see all data is because you have placed this code within a DisableControls/EnableControls. If you want to sort the data, I suggest to implement the OnCanSortColumn event, set ACanSort to False and then call sorting on the dataset instead, which will automatically update the grid.