Hi Boki,
I recently tried using your NextGrid6 component with some large datastructure containing 6 cols with a lot of very long strings
and over 3 000 Rows (the grid consists of TextColums only).
But I figured that it was quite slow compared to the standard Vcl-StringGrid.
Where populating the Vcl-StringGrid (with the exact same data) happend without any noticable delay,
when populating NextGrid6 the application froze for about 2 seconds (I used BeginUpdate; EndUpdate and AddRow(3 000)- all Rows at once, like you suggest in the documentation).
I'm guessing this is becouse you use WideString for all internal string processing.
Vcl-StringGrid uses the default String type which is UnicodeString (in Delphi Versions starting with Delphi 2010 I think).
Using UnicodeString is much faster then using WideString becouse it uses reference counting with copy on write.
WideString uses copy by value. (see http://docwiki.embar..._Types_(Delphi) )
You probably use WideString becouse of compatability to older Versions of Delphi, but it would be really
nice to have your components use UnicodeString (just string) for newer Versions .
To circumvent this speed issue I now use NextVirtualGrid6, but I ran into some questions and bugs:
1) I don't know how to make the grid reload it's data, for example when i change the data of my data-structure which gets queried in the getCell-Event.
I tried NextVirtualGrid61.DataChanged; but nothing happens.
2) There is an OnCulumnHeaderClick event, but it seems to never get called when i click on a ColumnHeader, maybe there is a bug?
3) If I pull the NextVirtualGrid6 and NextCellSource components on my Form their units are not automatically added to the uses list
(not really a big deal, but I wanted to point it out to you)
4) I noticed that NextVirtualGrid6 has some procedures for sorting. How do they work and how do I use them?
5) Feature Request: It would be nice to have an AfterCellSetEvent. I would like to call bestFitCol() in that event.
6) Also It would be nice to have an OnColumnHeaderClick-Event with a (aCol: Integer) parameter, let me illustrate that with some code:
Now if I want to assign the OnHeaderClick event with eg some custom sorting for the column I clicked,
I would have to assign an event for every column to implement some custom behavior for clicks on different columns:
Column1.OnHeaderClick := OnHeaderClick1;
Column2.OnHeaderClick := OnHeaderClick2; and so on..
What I would like to do instead is this:
interface
procedure FormCreate;
procedure OnHeaderClick(aCol: integer);
implemementation
procedure OnHeaderClick(aCol: integer);
begin
doSomeCustomStuffWithClickedColumn(aCol);
end;
procedure FormCreate;
begin
Column1.OnHeaderClick := OnHeaderClick;
Column2.OnHeaderClick := OnHeaderClick;
end;
I added a tiny sample project for better understanding of my obove points.
VirtualGrid_Sample.zip 53.82KB 5 downloads