FNCGrid saving column sizes in runtime

In vcl stringgrid exist the ColumnSize.save method to saving column sizes in runtime.

I need do same with FNCGrid. Exist a method to do this ?

You can use the following methods to save and load:

  TMSFNCGrid1.ColumnStatesToString;
  TMSFNCGrid1.StringToColumnStates()

thanks.

Hello Pieter,

is there a similar function for TMSFNCDataGrid? As the mentiond methods doesn't exist.

Hi,

With TTMSFNCDataGrid, you can save the widths to JSON:

s := TMSFNCDataGrid1.Root.ColumnWidthDictionary.JSON;

It will look something like:

'[{"2":100},{"1":250},{"0":70},{"3":100}]'

and then restore them with

  TMSFNCDataGrid1.BeginUpdate;
  TMSFNCDataGrid1.Root.ColumnWidthDictionary.JSON := s;
  TMSFNCDataGrid1.EndUpdate;