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
Edit events in NextGrid
Related Articles:
Info
- Skill:
- Version: 1.0.0
- Author: Bojan Nikolic
- Created:
- Updated: 2008-04-21
NextGrid have several events used in editing cell process. They are occur in next order:

OnBeforeEdit
This event first occur. It occur before cell jump into editing state:
1. By clicking on Cell
2. Start typing in Cell or
3. Calling EditCell method.
With using Accept parameter inside this event cell may prevent from editing. ACol and ARow parameters represents cell to be edited.
{ Cell 3, 4 can't be edited! } if (ACol = 3) and (ARow = 4) then Accept := False; { Cancel if cell content is empty string } if NextGrid1.Cells[ACol, ARow] = '' then Accept := False;
OnApplyEditText
This event occur immidiatelly after OnBeforeEdit, in moment when cell's value need to be transfered to InplaceEditor. This event include Value parameter with which edit text may be adjusted.
For example, if in cell value is "Jim@mail.cor", we may adjust it to "jim@mail.com" and similar examples.
if Value = '' then Value = 'none'; if IsValidEmail(Value) then Value := ValidEmail(Value);
OnEdit
OnEdit event occur in many situations when grid is in edit mode. It may occur when text is changed, new letter is typed, text is copyed or cleared or even new value is selected from drop-down control. It include Value parameter determining current value of text inside InplaceEditor.
OnEditAccept
This event occur when user finish with editing (select another cell, press Enter key...). This event include var Accept parameter which specify whathewer newly edited text will be accepted at all or editing will be simply finished without any changes made (OnEditExit event is called only).
if Value = '' then Accept := False; if Value = 'inapropriate value' then Accept := False; Accept := Length(Value) > 3;
OnAfterEdit
This event occur after editing is finished successfully.
OnEdiExit
This event occur at the end, it occurs even if editing is successfully done or canceled. This event is usefull when some resources need to be freed or some repainting to be done.
InplaceEditor
While grid is in editing process, InplaceEditor property is available.
This property actually represent editing control assigned to edited cell (edit box, combobox, date-picker...). You may access to it by using typecast for specific properties of some InplaceEditors. For example:
if TNxComboBox(NextGrid1.InplaceEdit).DropDownCount = 5 then ...
This area of component is upgraded durring time, and event names are maybe not 100% accurate due to keeping compatibility to older versions. If you have any suggestion or question do not hesitate to ask us.