Back to Devexpress

TileView.EditFormHidden Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-tile-dot-tileview-47ff8a9c.md

latest5.5 KB
Original Source

TileView.EditFormHidden Event

Fires after the Edit Form is closed.

Namespace : DevExpress.XtraGrid.Views.Tile

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DXCategory("Editor")]
public event EditFormHiddenEventHandler EditFormHidden
vb
<DXCategory("Editor")>
Public Event EditFormHidden As EditFormHiddenEventHandler

Event Data

The EditFormHidden event's data class is EditFormHiddenEventArgs. The following properties provide information specific to this event:

PropertyDescription
BindableControlsProvides 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.
PanelGets the container that arranges editors and buttons on the Edit Form. Inherited from EditFormEventArgsBase.
ResultGets the clicked button.
RowHandleGets the handle that identifies the grid row for which the Edit From is displayed/hidden. Inherited from EditFormEventArgsBase.

Remarks

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.

Example

The code below shows how to use the EditFormPrepared and EditFormHidden events to subscribe/unsubscribe to/from an editor’s events.

csharp
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;
}
vb
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

EditFormShowing

EditFormPrepared

Rows

TileView Class

TileView Members

DevExpress.XtraGrid.Views.Tile Namespace