NextGrid & NextDBGrid








NextGrid .NET

Upgrade existing projects for loading changes

Related Articles:

  • Skill:
  • Version: 1.0.0
  • Author: Bojan Nikolic
  • Created: 2008-10-01
  • Updated: 2008-10-01
This article is created for GridView users

NextGrid 2.9.5 come with new Columns stream loading routines. It is very important to read this article for safe migration from earlier version to new 2.9.5.

1. What is changed

In NextGrid 2.9.5 when new column is added from Columns Editor Column, Column variable will be added in Form unit:

TForm1 = class(TForm)
  NextGrid1: TNextGrid;
  NxTextColumn1: TNxTextColumn;
  NxNumberColumn1: TNxNumberColumn;
  NxProgressColumn1: TNxProgressColumn;

After Column variable is added in code, you will be able to type something like:

NxTextColumn1.Header.Caption := 'New Caption';

Also, some columns now have their own events: for TNxComboBoxColumn there is on OnCloseUp, OnSelect.

2. Recreate Column names

From version 2.9.5, each column added in design-time from Columns Editor MUST have own name AND have own variable in unit code. This is required because Columns with name are automatically registered in Delphi IDE.

If you still want to have Columns WITHOUT names read section below: 3. Skip setting column names

To convert existing projects for v2.9.5, follow next steps:

If your column already have own name, you need to RECREATE it:

1. Delete existing name
2. Set same name again

Delphi will add Column variable in code. You will be able now to see this column in Object TreeView in Delphi IDE.

If your column don't have own name select desired Column(s) and press "N" key

Each column will get own unique name and after you done with recreating column names, re-save your projects.

3. Skip setting column names

In Delphi only components with names are automatically registered in IDE. If you want to avoid this and have Columns WITHOUT name, add next lines in code:

In initialization section of unit, add next code:

for NextGrid

RegisterClasses([TNxButtonColumn, TNxGraphicColumn, TNxCheckBoxColumn,
  TNxDateColumn, TNxHtmlColumn, TNxImageColumn, TNxIncrementColumn,
  TNxComboBoxColumn, TNxNumberColumn, TNxProgressColumn, TNxRateColumn,

or for NextDBGrid:

RegisterClasses([TNxDBButtonColumn, TNxDBGraphicColumn, TNxDBCheckBoxColumn,
  TNxDBDateColumn, TNxDBHtmlColumn, TNxDBImageColumn, TNxDBIncrementColumn,
  TNxDBComboBoxColumn, TNxDBNumberColumn, TNxDBProgressColumn, TNxDBRateColumn,
  TNxDBTextColumn, TNxLookupColumn]);

in that case Column will be registered manually. If you don't use some column types you may skip them.

Was This Article Useful?

Only constructive comments, code contributions... will be publishes. Questions, non-official discussion will not be published.