windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-7eebed42.md
Fires after the Edit Form is closed.
Namespace : DevExpress.XtraGrid.Views.Grid
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DXCategory("Editor")]
public event EditFormHiddenEventHandler EditFormHidden
<DXCategory("Editor")>
Public Event EditFormHidden As EditFormHiddenEventHandler
The EditFormHidden event's data class is EditFormHiddenEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| BindableControls | Provides access to the collection of controls used to edit the processed data record. Controls are indexed by field names or grid columns. Inherited from EditFormEventArgsBase. |
| Panel | Gets the container that arranges editors and buttons on the Edit Form. Inherited from EditFormEventArgsBase. |
| Result | Gets the clicked button. |
| RowHandle | Gets the handle that identifies the grid row for which the Edit From is displayed/hidden. Inherited from EditFormEventArgsBase. |
The EditFormPrepared and ShowingPopupEditForm events allow you to access the Edit Form ‘s editors, for example, you can subscribe to an editor’s events. Use the EditFormHidden event to unsubscribe from the events.
Tip
The ValidateRow and RowUpdated events fire before and after changes are applied to a row. You can also handle these events to perform custom actions before and after the Edit Form is closed.
The code below shows how to use the EditFormPrepared and EditFormHidden events to subscribe/unsubscribe to/from an editor’s events.
using DevExpress.XtraEditors.Controls;
gridView1.EditFormPrepared += GridView1_EditFormPrepared;
gridView1.EditFormHidden += GridView1_EditFormHidden;
private void GridView1_EditFormPrepared(object sender, DevExpress.XtraGrid.Views.Grid.EditFormPreparedEventArgs e) {
TextEdit textEdit = e.BindableControls[colOrderID] as TextEdit;
if(textEdit != null)
textEdit.EditValueChanging += TextEdit_EditValueChanging;
}
private void TextEdit_EditValueChanging(object sender, ChangingEventArgs e) {
// ...
}
private void GridView1_EditFormHidden(object sender, DevExpress.XtraGrid.Views.Grid.EditFormHiddenEventArgs e) {
TextEdit textEdit = e.BindableControls[colOrderID] as TextEdit;
if(textEdit != null)
textEdit.EditValueChanging -= TextEdit_EditValueChanging;
}
Imports DevExpress.XtraEditors.Controls
AddHandler gridView1.EditFormPrepared, AddressOf GridView1_EditFormPrepared
AddHandler gridView1.EditFormHidden, AddressOf GridView1_EditFormHidden
Private Sub GridView1_EditFormPrepared(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.EditFormPreparedEventArgs)
Dim textEdit As TextEdit = TryCast(e.BindableControls(colOrderID), TextEdit)
If textEdit IsNot Nothing Then
AddHandler textEdit.EditValueChanging, AddressOf TextEdit_EditValueChanging
End If
End Sub
Private Sub TextEdit_EditValueChanging(ByVal sender As Object, ByVal e As ChangingEventArgs)
' ...
End Sub
Private Sub GridView1_EditFormHidden(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.EditFormHiddenEventArgs)
Dim textEdit As TextEdit = TryCast(e.BindableControls(colOrderID), TextEdit)
If textEdit IsNot Nothing Then
RemoveHandler textEdit.EditValueChanging, AddressOf TextEdit_EditValueChanging
End If
End Sub
See Also