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
- Using Editors in runtime
- FieldChooser Tutorial
- 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
- ToolbarItem tutorial
- NextInspector Advanced 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
- Quick update
- 32bit Bitmaps Tutorial
- Enable typing unicode characters in InplaceEditors
- Using NxColorScheme
- NxProgress Tutorial
- NxAutoCompletion Tutorial
Labs
NextGrid .NET
InputLine Tutorial
Related Articles:
Info
- Skill:
- Version: 1.0.0
- Author: Bojan Nikolic
- Created: 2008-05-21
- Updated: 2008-05-22
User may fill input cells and go trough then (with TAB key or mouse), and then by pressing Enter (or by clicking inside grid body) one new row will be added.
1. Enabling Input Line
Input line may be turned on by setting flag goInputLine in Options property of grid to True.
Input line also may be shown by right-click on component and choosing "Show Input Line" from pop-up menu.
New row may be added after pressing Enter key, or by clicking by mouse somewhere inside grid body.
If row is added by Enter, this may be additionally controlled by specifying InputEnterMode property.

2. Setting Input Line
Height of Input Line may be specified by InputSize property. Default value for this property is 16.
How Input Line will react when Enter key is pressed, may be specified by InputEnterMode property.
Name | Meaning |
---|---|
imAllways | New row will be added if InputLine is selected whenever input cell is in editing mode. |
imEdit | Default. New row will be added only if one of input cell is in editing mode. |
Property WantReturns must be set to True in order to imAllways work.
3. Setting Columns
Every column may show custom caption (in gray font) in own cell within Input Line. This is specified by ItemCaption property.
For example, value of this property may be: "click here to add new row" or similar.

This text automatically becomes hidden when user start editing this input cell.
Text entered in input cell is stored into InputValue property. This property may be readed in events such as OnInputAccept and decided about adding new row or not.
If input within some column need to be disabled, coCanInput flag in Options property need to be set to False.
4. Input Line Events
OnInputAccept - This event occur before new row is added, and here may be decided whenever to accept or cancel adding of new row.
Accept parameter - Specify whenever grid will accept new row. Good practice is to run trough all columns and inspect InputValue property. Then to set Accept parameter to True or False.
Example showing how to not accept empty rows:
procedure TForm1.NextGrid1InputAccept(Sender: TObject; var Accept: Boolean); var i: Integer; begin Accept := False; for i := 0 to NextGrid1.Columns.Count - 1 begin if NextGrid1.Columns[i].InputValue <> '' then begin Accept := True; Exit; end; end; end;
OnInputAdded - This event occur after new row is added from InputLine. This event may be suitable for additional operations such as selecting newly added row:
procedure TForm1.NextGrid1InputAdded(Sender: TObject); begin NextGrid1.SelectedRow := NextGrid1.LastAddedRow; end;