Speed NextGrid Save and Load
#1
Posted 15 January 2010 - 07:21 PM
When I save the grid with the 100.000 lines, it wil take a very long time (51.99 sec) and loadfromtext (62.77 sec) also.
I am new with NextGrid 5.0.6 and did not find something in the help file to speed up this actions with a large amount of rows. So my question is: Is there a way to speed up this operations?
For example the common Delphi listview can run in virtual mode and can handle large files and data.
Maybe something is build in NextGrid or comming for the component?
Thanks for your time, Dirk S.
#2
Posted 15 January 2010 - 10:12 PM
Try to add BeginUpdate at the start of loading and EndUpdate on the end.
This should speed up. Here is more details http://dn.bergsoft.n...ze-nextgrid.htm
Best regards
--
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.
#3
Posted 16 January 2010 - 01:13 AM
How do I combine load and save with AddRow(integer)?
And what about the virtual mode ?
Thanks DS
#4
Posted 16 January 2010 - 11:14 PM
You may use BeginUpdate/EndUpdate in any heavy situation.
Virtual mode is currently only supported for VirtualColumn. I will try to add virtual mode for NextGrid 6.
Best regards
--
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.
#5
Posted 17 January 2010 - 05:16 PM
Thanks for your answer. Gr DS
#6
Posted 01 December 2010 - 01:06 PM
It's almost a year ago I asked you something about fast saving and virtual mode. I hope you are experimenting with VM at this moment to add it in Nextgrid? DS
#7
Posted 16 March 2014 - 07:49 PM
Version 6 is comming now, I hope you have inplanted virtual mode for the NextGrid?!Virtual mode is currently only supported for VirtualColumn. I will try to add virtual mode for NextGrid 6.
Best regards
#8
Posted 16 March 2014 - 07:50 PM
#9
Posted 18 March 2014 - 04:41 PM
Every Column now include OnGetValue and OnGetText events (not only Virtual column). This is one step closer to virtual mode.
--
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.
#10
Posted 29 May 2017 - 12:26 AM
LS,
virtual mode is implanted I suppose, do you have an example how I can read from a big csv file into your grid?
thanks for your time.
#11
Posted 29 May 2017 - 08:34 PM
You can use NextVirtualGrid6 and NxVirtualCellSource6 components.
NxVirtualCellSource6 is non-visual component (that can be dropped on form) which connect grid with set of events.
procedure TForm5.FormCreate(Sender: TObject); begin NextVirtualGrid61.CellSource := NxVirtualCellSource61; { Call after any big change in order to repaint grid, re-calculate scrollbar } NextVirtualGrid61.DataChanged; end; function TForm5.NxVirtualCellSource61GetRowCount(Sender: TObject): Integer; begin // Our grid have 10000 rows Result := 10000; end;If you need to provide value, you will use following event:
procedure TForm5.NxVirtualCellSource61GetCell(Sender: TObject; ACol, ARow: Integer; Cell: INxCell); begin case ACol of 0: Cell.AsString := 'Test ' + IntToStr(ARow); 1: Cell.AsFloat := ARow; end; end;So, you don't use AddRow, InsertRow but you attach grid to your data (that you may have already pre-loaded).
--
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
Posted 25 October 2020 - 02:06 PM
LS,
About ten years ago I asked if NextGrid could run in virtual mode. In version 6 that would finally be possible. In the meantime we have reached version 6.6.0.
Can NextGrid run in virtual mode as the default Listview can? I want to show a Stringlist in memory without long waiting times on the screen.
Can I find a code example somewhere?
Groet Dirk S.
#13
Posted 25 October 2020 - 05:11 PM
Hello Dirk,
You can find mini (micro) demo inside Demos\NextVirtualGrid sub-folder. But basically you can use the code from 2 posts above to see how is like to work with virtual grid. Working with columns is 100% same, but providing data is different.
Hope that this helps.
--
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.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users