Still strugling with switching from LiveGrid to FNCGrid

I'm still strugling with the switch from the TMSFMXLivegrid to the TMSFNCGrid.
I created a little demo that show where I'm running into:

type
TForm13 = class(TForm)
TMSFNCGrid1 : TTMSFNCGrid;
Panel1 : TPanel;
Edit1 : TEdit;
Edit2 : TEdit;
BindNavigator1 : TBindNavigator;
VirtualTable1 : TVirtualTable;
DataSource1 : TDataSource;
TMSFNCGridDatabaseAdapter1 : TTMSFNCGridDatabaseAdapter;
BindSourceDB1 : TBindSourceDB;
procedure FormCreate(Sender: TObject);
procedure BindNavigator1Click(Sender: TObject; Button: TNavigateButton);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form13: TForm13;

implementation

{$R *.fmx}

procedure TForm13.BindNavigator1Click(Sender: TObject; Button: TNavigateButton);
begin
case Button of
nbFirst,
nbPrior,
nbNext,
nbLast:
begin
With TMSFNCGrid1 do
begin
Edit1.Text:= GetCellObject(MakeCell(0,SelectedRow[0])).Text;
Edit2.Text:= GetCellObject(MakeCell(1,SelectedRow[0])).Text;
end;
end;
end;
end;

procedure TForm13.FormCreate(Sender: TObject);
Var
i: Integer;
begin
VirtualTable1.Clear;
VirtualTable1.Close;
VirtualTable1.FieldDefs.Clear;
with VirtualTable1.FieldDefs.AddFieldDef do
begin
DataType:= ftInteger;
Name := 'id';
end;
with VirtualTable1.FieldDefs.AddFieldDef do
begin
DataType:= ftInteger;
Name := 'nr';
end;
VirtualTable1.IndexFieldNames:= ('id ASC');
VirtualTable1.Open;
for i := 1 to 500 do
begin
VirtualTable1.InsertRecord([Random(i100),Random(i1000)]);
end;

VirtualTable1.First;
DataSource1.DataSet := VirtualTable1;
BindSourceDB1.DataSource := DataSource1;
BindNavigator1.DataSource := BindSourceDB1;
TMSFNCGridDataBaseAdapter1.DataSource := DataSource1;
TMSFNCGridDataBaseAdapter1.Grid := TMSFNCGrid1;
TMSFNCGridDataBaseAdapter1.Active := True;
TMSFNCGrid1.Options.Selection.mode := smDisjunctRow;
TMSFNCGrid1.Options.Editing.Enabled := False;
TMSFNCGridDataBaseAdapter1.LoadAllDataAndDisconnect;
TMSFNCGridDataBaseAdapter1.Active := True;
end;

What am I doing wrong and how can I do that the right way.
TIA Anske

An access violation is typically accessing something that is not assigned. I see the following code:

Edit1.Text:= GetCellObject(MakeCell(0,SelectedRow[0])).Text;
Edit2.Text:= GetCellObject(MakeCell(1,SelectedRow[0])).Text;

I suppose GetCellObject returns an empty object?

I don't know, scrolling (with the next button of the navigatorbar) from top down, the first 7 or 8 rows works fine after that the access violation appears.

Hi!
I don't have access to devart TVirtualTable, but I've run before into this 7-8 rows issue when using LoadAllDataAndDisconnect. I was using BlockReadSize in my Dataset, so it behaves someway that is not "compatible" with the grid's db adapter & LoadAllDataAndDisconnect.

Maybe you could try change some properties of your VirtualDataset, or test your program using a "native" dataset and see if it works.

I think I found a solution:
Adapt:= TTMSFNCGridDatabaseAdapter(TMSFNCGridDatabaseAdapter1);
if Adapt.CheckDataSet then
begin
Edit1.Text:= Adapt.FieldAtColumn[0].AsString;
Edit2.Text:= Adapt.FieldAtColumn[1].AsString;
end;
This works so far so good

Thanks for the feedback!