The user can update or insert the value of the data row by directly editing the data cell. First, we will learn how to update the existing row.
When you move Focus to the data cell contained in the row to be updated and type F2 key, the editor set in the column will be displayed. After displaying the editor, if the corresponding cell is updatable, you can start editing. And, you can also type the text to display the editor when you start typing. onShowEditor event will be fired just before the editor is displayed, and if explicitly return false within the event handler, the editor will not be displayed and cell updating cannot be proceeded either.
In order to commit the cell editing, you can type Enter, Tab or arrow keys or click the mouse to leave the cell being typed. onEditCommitted event will be fired when the cell editing is committed. In order to commit the editing successfully, you must pass Validation. In the grid below, Validation has been set to make "Year" value be at least 2000.
Basically, SMART datagrid commits the editing on a row basis. In other words, the entered values will be transferred to the data set only if the row editing is committed. In order to commit the row editing, you should use arrow keys or click the mouse to change the row location or directly call GridBase.commit method. GridBase.onEditRowCommitted event will be fired when the row editing is committed. In the case of the row updating, if specify EditOptions.updateByCell as true, you can commit the row editing on a cell basis.
If type Esc key when the editor is displayed, the cell editing will be cancelled and onEditCanceled event will be fired. Also, if type Esc key when the editor is not displayed in the row being edited, the row editing will be cancelled. onEditRowCanceled event will be fired when the row editing is committed.
The minimum height of the editor has been set as 22 pixels in EditOptions.minEditorHeight property. You can test with changing the height of the row.
When you move the focus to the location in which you will insert a new row and type Insert key, the row inserting will be started. Cell editing, row editing commit UI and event are the same as the row updating. The user can proceed the row inserting only if EditOptions.insertable is specified as true. Also, you can call GridBase.insert to start the row inserting.
If type the down key when the focus is in the last row, the row appending will be started. The user can proceed the row appending only if appendable is specified as true. Also, you can directly call GridBase.append to start the row appending.