Back to Devexpress

GridView.ShowEditForm() Method

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-99656592.md

latest4.0 KB
Original Source

GridView.ShowEditForm() Method

Opens an Edit Form for the focused row.

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public virtual void ShowEditForm()
vb
Public Overridable Sub ShowEditForm

Remarks

The ShowEditForm method opens an Edit Form for the focused row if the GridOptionsBehavior.EditingMode property is set to one of the following values:

Note

If the GridView lacks sufficient space to display an inline Edit Form, a modal Edit Form window is displayed.

The following code snippet shows a modal Edit Form window on a button click:

csharp
using DevExpress.XtraGrid.Views.Grid;

gridView1.OptionsBehavior.EditingMode = GridEditingMode.EditForm;
// ...
void editButton_Click(object sender, EventArgs e) {
    gridView1.ShowEditForm();
}
vb
Imports DevExpress.XtraGrid.Views.Grid

gridView1.OptionsBehavior.EditingMode = GridEditingMode.EditForm
' ...
Private Sub editButton_Click(sender As Object, e As EventArgs) Handles editButton.Click
    gridView1.ShowEditForm()
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowEditForm() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

connect-winforms-grid-to-backend-using-middletier-server/CS/WinForms.Client/MainForm.cs#L137

csharp
private void bbiEdit_ItemClick(object sender, ItemClickEventArgs e) {
    gridView.ShowEditForm();
}

connect-winforms-grid-to-backend-using-middletier-server/VB/WinForms.Client/MainForm.vb#L96

vb
Private Sub bbiEdit_ItemClick(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    gridView.ShowEditForm()
End Sub

See Also

ShowPopupEditForm()

ShowInplaceEditForm()

GridEditingMode

EditingMode

GridView Class

GridView Members

DevExpress.XtraGrid.Views.Grid Namespace