Skip to main content

Showing and Hiding Editors

Note

End-users can invoke cell editors and change cell values if the grid’s DataControlBase.AllowEditing property is set to true and the DataControlBase.NavigationStyle property is set to GridControlNavigationStyle.Cell.

End-users can switch the grid to edit mode by clicking the required cell, or by pressing the ENTER or F2 key. This activates the focused cell’s inplace editor, allowing the user to modify the focused cell value. To save the changes made and close the editor, the end-user should press ENTER, or move cell focus to another cell. Pressing ESC closes the editor, discarding all changes made.

Cell editors can also be activated and closed in code.

To programmatically activate the cell’s editor, you should focus the cell and call the DataControlBase.ShowEditor method. After the editor is shown, the grid fires the GridControlBase.ShownEditor event.

There are two methods that hide the active editor. The DataControlBase.CommitEditing method hides the active editor, saving the changes made. The DataControlBase.HideEditor method hides the active editor, but discards the changes. To save changes to a data source without closing the active editor, use the DataControlBase.PostEditor method.

After the editor is closed, the grid fires the GridControlBase.HiddenEditor event.