Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataGridView.EditorShowing Event

Fires when a cell editor is about to be displayed and allows you to cancel the action.

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

#Declaration

C#
public event EventHandler<EditorShowingEventArgs> EditorShowing

#Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
FieldName Gets or sets the field name of the column for which the editor is about to be displayed. This is a bindable property.
Item Gets the data item that corresponds to the data grid item for which the editor is about to be displayed.
RowHandle Gets the handle of the row that contains a cell for which the editor is about to be displayed.

#Example

The code below shows how to prevent the Priority column from being edited if an item was sent more than a month ago.

Data Grid View Showing Editor

<dxg:DataGridView x:Name="dataGridView"
                  Grid.Row="1"
                  EditorShowMode="Tap"
                  EditorShowing="dataGridView_ShowingEditor"
                  ItemsSource="{Binding Path=OutlookData}"
                  Tap="Handle_Tap"
                  ValidateCell="DataGridView_ValidateCell"
                  ValidationError="DataGridView_ValidationError">
    <dxg:DataGridView.Columns>
        <dxg:NumberColumn FieldName="Id" Width="70" IsReadOnly="true"/>
        <dxg:ComboBoxColumn FieldName="Priority" MinWidth="120"/>
        <dxg:TextColumn FieldName="From.Name" Caption="From" MinWidth="150" ClearIconVisibility="Auto"/>
        <dxg:DateColumn FieldName="Sent" Width="110"/>
        <dxg:TimeColumn FieldName="Time" Width="100"/>
    </dxg:DataGridView.Columns>
</dxg:DataGridView>
See Also