TMS FNCDataGrid Grouping AV

I´m testing the TMSFNCDataGrid in a Firemonkey-project.
So far i really like it.

In my Test-Project i get an AV when i try to collapse a row (DetailControl is not assigned):

I´ve bound a datasource to the Grid and set LoadMode in the Adapter to almAllRecords:

procedure TMainForm.Btn_GroupClick(Sender: TObject);
begin
  TMSFNCDataGrid1.Ungroup;

  TMSFNCDataGrid1.Group(TMSFNCComboBox1.ItemIndex);
end;

procedure TMainForm.FormShow(Sender: TObject);
var
  lAdataper: TTMSFNCDataGridDatabaseAdapter;
  I: Integer;
begin
  lAdataper := TMSFNCDataGrid1.Adapter as TTMSFNCDataGridDatabaseAdapter;
  lAdataper.DataSource := DataSource1;
  lAdataper.AutoCreateColumns := True;

  TMSFNCComboBox1.Text := '';
  TMSFNCComboBox1.Items.Clear;
  for I := 0 to lAdataper.Columns.Count - 1 do
  begin
    TMSFNCComboBox1.Items.Add(lAdataper.Columns[I].FieldName);
  end;
  TMSFNCComboBox1.ItemIndex := 0;

end;
1 Like

Hi,

Thank you very much for the feedback. We've applied a fix. The fix is simple:

In

procedure TTMSFNCCustomDataGridDatabaseAdapter.RowCollapse(ARow: Integer);

Check for

    if Assigned(DetailControl) then
      DetailControl.Visible := False;

DetailControl is only used in Master-Detail relationships, so we forgot the assignment check.

Thank you for the quick reply :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.