Looking for how to save a cxgrid layout (devexpress) using Storetostorage

Asked

Viewed 1,609 times

1

In Delphi, a grid cxgrid of devexpress, I look for how to save the layout in the database. I have here functions to save in ini, but this produces several files in the folder and would like to save these settings in the database

For this I was thinking of using Storetostorage, saving on the bench in string. Or if I do not find I will have to throw this ini on the bench...

Does anyone have any example of code using Storetostorage?

Example with INI Save

procedure TFrm_BI_Exemplo.actDoSaveExecute(Sender: TObject);
begin
 grdPadraoCxDBTableView1.StoreToIniFile(ExtractFilePath(Application.ExeName) + '/filtros/Teste.ini', true, [gsoUseFilter, gsoUseSummary]);
end

Example with INI Load

procedure TFrm_BI_Exemplo.actDoLoadExecute(Sender: TObject);
begin
     grdPadraoCxDBTableView1.RestoreFromIniFile(ExtractFilePath(Application.ExeName) + '/filtros/teste.ini', true, false, [gsoUseFilter, gsoUseSummary]);
end;

Thank you all

  • I haven’t touched Dev’s grids in a long time, but I must have something with their samples. At night, from home I take a look and talk to you

  • @Caputo thank you because I haven’t found any examples about Storetostorage, or using Storetostream even. Here at the time of restoring the grid is all type a column, several blank records. Comparing what saves ini and these in BLOB, it seems to me that saving comes much less information...

  • When possible I will put more details, but from what I saw this storetostorage does not work no. To solve I used Storetoinifile saving in ini file and then putting its information in a blob using cdsNomeClientDataSetCAMPO.Loadfromfile('ini path'). I would not like to use it like this but I found an answer in the devexpress support that says:

  • 1

    "I am afraid that this Functionality is not supported. The Storetostream method Saves layouts only in Binary representation. We are Aware of this limitation, but do not have plans to change it in the near Future. This task is very specific and requires Rewriting a Lot of code from Scratch.".

  • https://www.devexpress.com/Support/Center/Question/Details/Q529793

  • Note: When I say does not work would be in the version that use Delphi 2006 and using Expressquantumgrid Suite 6.38 . When possible I will update to see.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.