Jump to content


Photo

Serialize.LoadFromINI & Columns.Update


  • Please log in to reply
19 replies to this topic

#1 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 05 March 2024 - 11:34 AM

Hi Bojan,

 

When I save my Columns and Load it back The Columns are not showing correctly like I want to. 

(36 columns and about 18 not visible)

 

I must load it twice and then it will be alright. So there is a problem in de Update procedure?

procedure TfrmFinalDupeChecker.btnLoadCFGClick(Sender: TObject);
begin
  NextVirtualGrid.Serialize.LoadFromINI(ChangeFileExt(Application.ExeName, '.ngr'));
  NextVirtualGrid.Columns.Update;

  // And Again

  NextVirtualGrid.Serialize.LoadFromINI(ChangeFileExt(Application.ExeName, '.ngr'));
  NextVirtualGrid.Columns.Update;
end;

Can you fix this?

I have no demo because when less Columns and probably less/more visible there is no problem.

it's random that it goes wrong.

 

Regards,

Eduard.

 

 



#2 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 07 March 2024 - 09:47 AM

Hello?



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 07 March 2024 - 06:06 PM

Hello Eduard,

 

I will inspect this and fix it as soon is possible.


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.

#4 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 08 March 2024 - 06:41 AM

Thank you.

Will you show solution in this topic because I need it fast?



#5 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 15 March 2024 - 09:44 AM

Any Luck?



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 March 2024 - 11:15 AM

Hello,

 

I didn't managed to reproduce it yet. While I tested I Saved and Loaded different number of columns and that caused mismatch. I will try to test it little bit more.


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.

#7 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 15 March 2024 - 11:22 AM

What I did is in Design time add 5 fields (0..4). The rest is dynamically.

 

Attached File  BOKI 2024-03-08_094425.jpg   46.88KB   0 downloads

 

Thinking: If I remove the last icon field (4) there is no problem by my previous version.

Maybe accidentally.

 

In my FinalPlayer I use only two design time Icon field and the rest dynamically and no problem there.

 

Maybe this can help?



#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 March 2024 - 11:34 AM

Hello,

 

I think that there should be no problems with design and run-time columns. Only thing that is required is that the order and count of Saved and Loaded columns are equal.


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.

#9 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 15 March 2024 - 11:37 AM

I always save it when ended the program and load when started.

Always after INIT the NextGrid.



#10 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 16 March 2024 - 01:08 PM

Found kind of error. First change this in your 'procedure TNxGridSerialization.ReadFromINI'

 

// NOT CORRECT? Columns[i].Visible := IniFile.ReadBool('Visible Columns' + ID, 'Column' + IntToStr(i), True);
Must be:  Columns[i].Visible := IniFile.ReadBool('Visible Columns' + ID, 'Column' + IntToStr(i), Columns[i].Visible); // <<<< Columns[i].Visible (not default TRUE)

 

Because I create some columns with default visible FALSE. As you can see you set this at first to TRUE when reading non existing INI file.

 

Now to the problem...

I created a demo and can reproduce the fault.

 

Attached File  VirtualGrid_TEST.zip   2.46KB   5 downloads

 

Try it several times and some columns are not correct after a re-run.

 

Hope you can find this little problem :)

 

 



#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 March 2024 - 03:12 PM

Hello,

 

This is probably the problem. Does it work well after you added this fix?

 

I will include it in the official releases then.


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.

#12 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 16 March 2024 - 03:58 PM

Hi,

 

No this is not the problem it's only a small fix. The visibility was not the main problem but de order of columns after a restart. 

 

Just check the demo and move some columns and close it and start up again than you can see that the order is not correct.

In de demo i hide some columns so you must run it after the first fix.



#13 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 16 March 2024 - 04:26 PM

Here is a screenshot.

 

Attached File  BEFORE-2024-03-16_142156.jpg   11.39KB   1 downloads

 

Now I close the demo and start it up again.

 

Attached File  AFTER-2024-03-16_142302.jpg   12KB   1 downloads

 

Now you can see that the column order is different. 

 

Hope it's now more clearly.



#14 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 17 March 2024 - 10:43 PM

Please let me now ?



#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 18 March 2024 - 02:24 AM

Hello,

 

I have downloaded your demo project. It will take some time to solve the issue.


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.

#16 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 04 April 2024 - 09:47 AM

And have you been able to find the problem yet?



#17 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 April 2024 - 12:26 AM

Hello Eduard,

 

I have added the visibility fix, but not yet managed to solve the position problem. I’m hoping to fix it for the 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.

#18 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 05 April 2024 - 07:47 AM

We will wait :)



#19 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 08 April 2024 - 03:31 PM

Hello,

 

I think that I have fixed it. You can re-download latest PRE release from the users section.


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.

#20 DelphiToday

DelphiToday
  • Members
  • 149 posts
  • Gender:Male

Posted 09 April 2024 - 09:18 AM

I update the file 'NxGridSerialization6.pas' and seems to be good now.

Thank you :)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users