Documents
NextGrid & NextDBGrid
- Html Column Tutorial
- Upgrade existing projects for loading changes
- Edit events in NextGrid
- NextGrid Vista Style
- NextGrid How To
- Integrating Inplace Editors
- NextGrid Slide Style Tutorial
- InputLine Tutorial
- FieldChooser Tutorial
- Using Editors in runtime
- Grid Report Tutorial
NextGrid
- TreeColumn Tutorial
- NextGrid Quick Start
- Custom Draw in NextGrid
- Export to XML from NextGrid
- Optimize NextGrid
- NextGrid Custom Sorting
- VirtualColumn Tutorial
- Graphic Column Tutorial
NextDBGrid
- NextDBGrid Quick Start
- NextDBGrid Events
- NextDBGrid How To
- Sorting records in NextDBGrid
- LookupColumn Tutorial
NextInspector
- NextInspector Advanced tutorial
- ToolbarItem tutorial
- NextDBInspector Tutorial
- NextInspector Item Types
- Map VCL property to item
- NextInspector Quick Start
NextSheet
NextCollection
- NxAlertWindow Tutorial
- NxInfoPanel Tutorial
- Vista Styled Panels
- NxPathControl and NxNotebook tutorial
- NxPathControl Quick Start
- NxFlipPanel and NxHeaderPanel Quick Start
- NxOutlookBar Tutorial
- NxPageControl and NxNotebook Quick Start
- NxButton Tutorial
Misc
- Component Names Change
- NxComboBox styles
- Numeric FormatMask
- NxVirtualDataSet tutorial
- DateTime FormatMask
- NxPreview Quick Start
- 32bit Bitmaps Tutorial
- Quick update
- Enable typing unicode characters in InplaceEditors
- Using NxColorScheme
- NxProgress Tutorial
- NxAutoCompletion Tutorial
Labs
NextGrid .NET
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