Documents
NextGrid & NextDBGrid
- Integrating Inplace Editors
- Upgrade existing projects for loading changes
- FieldChooser Tutorial
- 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
- NextGrid Custom Sorting
- TreeColumn Tutorial
NextDBGrid
NextInspector
- NextInspector Item Types
- NextInspector Quick Start
- NextDBInspector Tutorial
- NextInspector Advanced tutorial
- Map VCL property to item
NextSheet
NextCollection
- NxInfoPanel Tutorial
- 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
- Component Names Change
- 32bit Bitmaps Tutorial
Labs
TreeColumn Tutorial
Related Articles:
Info
- Skill:
- Version: 1.0.1
- Author: Bojan Nikolic
- Created:
- Updated: 2008-04-22
Please note that Tree Column implementation is still in
Adding TreeColumn
TreeColumn (TNxTreeColumn) is normal NextGrid column and can be added at any place inside Grid, any times needed.
To add one TNxTreeColumn, click on TreeColumn icon:

Customizing TreeColumn
TreeColumn appearance can be customized with following properties:
ExpandLock - Disable clicking on
and
buttons.ShowLines - Show/Hide Tree Lines.
ShowButtons - Show/Hide
and
buttons.Adding Rows
Tree structure can be build with AddChildRow and InsertChildRows methods.
AddChildRow method have following parameters:
| Name | Type | Meaning |
|---|---|---|
| Index | Integer | Index of Parent Row. |
| Position (optional) | Integer | Position of Child Row (crFirst - new row will be first child row, crLast - new row will be last child row |
with NextGrid1 do begin AddRow; Cells[0, LastAddedRow] := '[root]'; AddChildRow(0); Cells[0, LastAddedRow] := 'two'; AddChildRow(0); Cells[0, LastAddedRow] := 'one'; AddChildRow(0); Cells[0, LastAddedRow] := 'three'; AddChildRow(LastAddedRow); Cells[0, LastAddedRow] := 'one more child row'; end;
Result:

In this sample we have use property LastAddedRow to determine Index of last added row inside Grid.
Deleting Rows
Child row may be deleted with using DeleteRow method and with sending Row's absolute index as parameter:
DeleteRow(AbsoluteIndexOfRow);
To delete child row, without knowing absolute index, use DeleteChildRow method:
DeleteChildRow(ParentIndex, Index);
| Name | Type | Meaning |
|---|---|---|
| ParentIndex | Integer | Determine absolute index of parent row |
| Index | Integer | determine relative index of child row inside Parent row. |
Working with Nodes
NextGrid also have several methods for easy working with Nodes.
GetNextSibling returns the next row (node) in the tree at the same level as the calling row.
GetPrevSibling returns the previous row (node) in the tree at the same level as the calling row.