Documents
NextGrid & NextDBGrid
- Integrating Inplace Editors
- Upgrade existing projects for loading changes
- Grid Report Tutorial
- FieldChooser Tutorial
- Using Editors in runtime
- NextGrid How To
- Html Column Tutorial
- NextGrid Slide Style Tutorial
- InputLine Tutorial
- Edit events in NextGrid
- NextGrid Vista Style
NextGrid
- NextGrid Quick Start
- Graphic Column Tutorial
- Optimize NextGrid
- Custom Draw in NextGrid
- VirtualColumn Tutorial
- Export to XML from NextGrid
- NextGrid Custom Sorting
- TreeColumn Tutorial
NextDBGrid
- Sorting records in NextDBGrid
- NextDBGrid Events
- NextDBGrid Quick Start
- NextDBGrid How To
- LookupColumn Tutorial
NextInspector
- NextInspector Item Types
- NextInspector Quick Start
- NextDBInspector Tutorial
- NextInspector Advanced tutorial
- ToolbarItem tutorial
- Map VCL property to item
NextSheet
NextCollection
- NxInfoPanel Tutorial
- Vista Styled Panels
- NxPathControl and NxNotebook tutorial
- NxAlertWindow Tutorial
- NxPathControl Quick Start
- NxButton Tutorial
- NxOutlookBar Tutorial
- NxFlipPanel and NxHeaderPanel Quick Start
- NxPageControl and NxNotebook Quick Start
Misc
- DateTime FormatMask
- NxAutoCompletion Tutorial
- Using NxColorScheme
- NxComboBox styles
- Enable typing unicode characters in InplaceEditors
- NxProgress Tutorial
- NxPreview Quick Start
- Numeric FormatMask
- NxVirtualDataSet tutorial
- Component Names Change
- 32bit Bitmaps Tutorial
- Quick update
Labs
LookupColumn Tutorial
Related Articles:
Info
- Skill:
- Version: 1.0.1
- Author: 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".
Comments
2008-07-15 22:53:16
For lookup column example, how setup lookup properties in runtime mode. ?
2008-07-18 12:32:49
Hello,
You simply need to use typecast
I hope that it helps.
You simply need to use typecast
TNxLookupColumn(NextDBGrid.Columns[2]).ListDataSource...
I hope that it helps.
2009-03-06 09:41:41
Is it possible to use only keyboard to select items ? Incremental search or select by arrows ?
2009-03-06 09:44:29
Hello,
Keys are supported, but Incremental search not yet.
Best regards
Keys are supported, but Incremental search not yet.
Best regards
2009-03-18 11:40:40
Is it possible to set "ListFieldName" using more than one column?
2009-03-18 11:51:54
Is it possible to set "ListFieldName" using more than one column?
Unfortunatelly by now it is not possible
Unfortunatelly by now it is not possible