Jump to content


Photo

Does v6 allow for saving grid configurations to the registry?

SaveToRegistry

  • Please log in to reply
5 replies to this topic

#1 Jim Rollins

Jim Rollins
  • Members
  • 5 posts

Posted 30 June 2021 - 08:15 PM

I'm moving from v5 to v6 (finally). I've used the grid.SaveToRegistry(path, 'NAME') procedure to save the grid configuration. Note: I do not want to save the contents of the grid, just the configuration. This allows the user to manipulate the grid (manually changing the column widths mostly) and have those changes appear the next time they run the program.

 

That procedure does not appear to be present in v6. Is there a work around?

 

Thanks,

Jim



#2 Jim Rollins

Jim Rollins
  • Members
  • 5 posts

Posted 30 June 2021 - 09:04 PM

Found it. Sorry for the inconvenience.

 

v5: grid.SaveToRegistry('path', 'folder_name');

 

v6: grid.Serialize.SaveToRegistry('path', {hive key})

      where {hive key} is one of HKEY_CURRENT_USER (recommended) or HKEY_LOCAL_MACHINE. Note that the hive key is not placed inside of quotation marks.

 

In my situation, I set "path" to "SOFTWARE\{company_name}\{program_name}\Grids\{grid name}". NextGrid created folders underneath {grid name} for:

  "Column Sizes"

  "Column Sort Kind"

  "Common"

  "Positions"

  "Sorted"

  "Visible Columns"

 

The procedure saved only the grid configuration.

 

Thanks for such a great product!

 

Jim



#3 Jim Rollins

Jim Rollins
  • Members
  • 5 posts

Posted 30 June 2021 - 09:16 PM

Whoops. I declared victory too soon.

 

Boki, I can't find the v5 "grid.LoadFromRegistry" procedure. Does it exist?

 

Jim



#4 Jim Rollins

Jim Rollins
  • Members
  • 5 posts

Posted 01 July 2021 - 05:22 PM

Correction: "Boki, I can't find the v6 'grid.LoadFromRegistry' procedure."



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 02 July 2021 - 01:52 AM

Hi Jim,

 

i will try to add it soon, maybe even for upcoming release.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 Jim Rollins

Jim Rollins
  • Members
  • 5 posts

Posted 21 September 2021 - 03:19 PM

Just downloaded the 6.6.9 release. Thank you for putting in/fixing the "SaveToRegistry"/"LoadFromRegistry" procedures. I use them in every program and my users love the feature.

 

MyGrid.Serialize.LoadFromRegistry('Software\{MyCompany}\{Customer}\{Program}\{Form}\{grid}');

MyGrid.Serialize.SaveToRegistry('Software\{MyCompany}\{Customer}\{Program}\{Form}\{grid}');

 

It defaults to the "HKEY_CURRENT_USER" hive.

The multiple folders insures there won't be any collisions.

Make sure you use backslashes ("\") to maintain the registry tree structure.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users