FNCDataGrid - DetailControl without DataGridDatabaseAdapter

Hi,

I'm starting to get familiar with FNCDataGrid component and I would like to add a panel between rows for changing data. For example it would look something like that:
image

After I click on 'Edit', it would expand with panel:

I managed to make it work with DataGridDatabaseAdapter, but is there any way without using database?

Kind regards,
Bostjan

Yes, you can do everything you want without a database adapter.

  1. Drop a TTMSFNCDataGrid on the form
  2. Drop a panel on the form add some controls
  3. Add the following code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFNCDataGrid1.LoadSampleData;
  TMSFNCDataGrid1.InsertRow(2);
  TMSFNCDataGrid1.Controls[0, 2] := Panel1;
  TMSFNCDataGrid1.MergeCells(0, 2, TMSFNCDataGrid1.ColumnCount, 1);
  TMSFNCDataGrid1.AutoSizeRow(2);
  TMSFNCDataGrid1.ControlAligns[0, 2] := gcaClient;
end;

Hi, Pieter!

Thank you for explanation, it worked. But how do I close this panel then properly? I've tried to deleteRow, but it doesn't work.

Deleting a row is only possible when there are no merged cells. Before calling DeleteRow, please call SplitCell

TMSFNCDataGrid1.SplitCell(MakeCell(0, 2));
TMSFNCDataGrid1.DeleteRow(2);

Hi,

I've tried, but no success. This it how it looks before DeleteRow:

And after delete:

We tested this here and couldn't reproduce, please send a sample. Also, are you using the latest version?

Hi Pieter,
Does this scenario also work on the web version of FNCDataGrid?
Interesting...
Thanks

Hi, Pieter!

I've tried now with the latest version (1.5.02) also and I have the same problem.
In attachment I'm sending you my demo sample. After you start it, click populate, then click 'Edit' to open the panel and then 'Cancel' to close it.
DataGridDemo.zip (9.3 KB)