Jump to content


Photo

TNextVirtualGrid6 component added

virtual grid v6

  • Please log in to reply
4 replies to this topic

#1 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 02 April 2014 - 03:46 AM

Hi,

I am working hard these days to add support for virtual using of grid.

And, I have next results:

Between TNxCustomGrid6 and TNextGrid6 I have added one more class TNextVirtualGrid. This class is also published on Components/Tool Palette on NextSuite 6 tab.

This class is actually a TNextGrid6 without Cells logic implemented, so it is virtual for you to connect it to your data directly.

Why to use virtual mode?

- If you already store data in some custom structure, with virtual mode you will not duplicate data. As you know NextGrid store own 2-dimensional array of cells.

- Sometimes your data is calculated (or streamed) and you don't have a need to store data anywhere.

How data is connected?

There is a non-visual component TNxVirtualCellSource6 (on NextSuite 6 tab too) which include events such as:
- OnGetRowCount
- OnGetCell
etc.

And, then you need to connect grid with this non-visual control.

For example, I have created 1 view and added 2 columns (text and number).

procedure TForm3.Button1Click(Sender: TObject);
begin
  // Here we set connection
  NextVirtualGrid61.CellSource := NxVirtualCellSource61;
end;

procedure TForm3.NxVirtualCellSource61GetCell(Sender: TObject; ACol,
  ARow: Integer; Cell: INxCell);
begin
  // Here we set value for cell, quite easy <img src='http://www.bergsoft.net/forum/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' />
  case ACol of
    0: Cell.AsString := 'test string';
    1: Cell.AsFloat := ARow;
  end;
end;

function TForm3.NxVirtualCellSource61GetRowCount(Sender: TObject): Integer;
begin
  // Total number of rows.
  Result := 5;
end;

Important note is that Columns will not be virtual, so you will need to add them in designer.

Please note that files are not yet uploaded, I will upload it in upcoming days. If you have any comments please tell me.

So far is working nice, but I need to check some it more.

Best regards
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.

#2 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 02 April 2014 - 12:47 PM

I'm looking forward to this. I like it. Hell of a work to translate here the old NextGrid5 to the new standard. Just step by step.
Thank's for bringing a good job and a nice tool.
Regards,
Eduard.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 02 April 2014 - 06:48 PM

Hi,

I start to like it a lot. For example, your grid may have a millions (or billions) of rows without any memory loss and instantly added.
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 03 April 2014 - 07:12 AM

Hi Eduard (and others)

Can you also tell me which events you need.

Here are some:
- OnGetRowCount
- OnGetCell
- OnGetRow (there you will be able to set Selected property of Row)
- Event triggered when cell is changed (via editing)
- User will be able to call NextVirtualGrid.AddRow, DeleteRow etc. which will shift grid for new/deleting row, but you will off-course need to provide data.

I need to know them all before I made next step.
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.

#5 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 05 April 2014 - 09:27 AM

For this moment i don't know if i need extra Events. I hope you provide me the XE4 Package soon. That's my first start before conversion.
Regards,
Eduard.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users