Documents
NextGrid & NextDBGrid
- FieldChooser Tutorial
- NextGrid How To
- InputLine Tutorial
- Html Column Tutorial
- NextGrid Slide Style Tutorial
- Edit events in NextGrid
NextGrid
- NextGrid Quick Start
- Graphic Column Tutorial
- Optimize NextGrid
- Custom Draw in NextGrid
- VirtualColumn Tutorial
- NextGrid Custom Sorting
- TreeColumn Tutorial
NextDBGrid
- NextDBGrid Events
- NextDBGrid Quick Start
- LookupColumn Tutorial
NextInspector
- NextInspector Item Types
- NextInspector Quick Start
- NextInspector Advanced tutorial
- Map VCL property to item
NextSheet
NextCollection
- NxInfoPanel Tutorial
- NxOutlookBar Tutorial
- NxPathControl and NxNotebook tutorial
- NxPathControl Quick Start
- NxButton Tutorial
- NxFlipPanel and NxHeaderPanel Quick Start
- NxPageControl and NxNotebook Quick Start
Misc
- DateTime FormatMask
- NxComboBox styles
- NxPreview Quick Start
- Numeric FormatMask
- Enable typing unicode characters in InplaceEditors
- 32bit Bitmaps Tutorial
Labs
LookupColumn Tutorial
Related Articles:
Info
- Skill:
- Version: 1.0.1
- Authod: Bojan Nikolic
- Created:
- Updated: 2008-04-22
Introducing
With using Lookup Column we can combine Fields of 2 Tables or Queries to get result similiar when using SQL Join commands.
Sometime we need to represent Field from first table with using Values from second Field. To do this, we need to link this 2 Fields with using properties from TNxLookupColumn.
TNxLookupColumn is located at the secong "Tab" inside Next DBGrid Columns Editor.
Example Tables
In this example we have 2 tables: Articles and ArticleTypes.
We need to link ArticleTypeId Field from first Table to Id Field from second Table.

Set Lookup Column
Now, we will set TNxLookupColumn:
1. Place 2 TTable (TADOTable, TIBTable, TZTable...) components and 2 TDataSource components on form.
2. Place NextDBGrid on Form and add one TNxLookupColumn.
3. Select this column and set next properties
4. Property FieldName will be set as usual to desired Field from first table - "ArticleTypeId"
5. Property KeyFieldName - Key Field from ArticleTypes Table. This property will have "Id" as Value.
6. ListDataSource - Set to second DataSource
7. ListFieldName - Set to displaying Field from second Table. In our case is "Name".