Skip to main content
A newer version of this page is available. .

DataGridView.ShowingEditor Event

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

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

NuGet Package: DevExpress.XamarinForms.Grid

Declaration

public event ShowingEditorEventHandler ShowingEditor

Event Data

The ShowingEditor event's data class is ShowingEditorEventArgs. 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 the name of the data field for which an editor is about be displayed.
Item Gets an object that specifies a record in the grid’s underlying data source.
RowHandle Gets the processed row’s handle.

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"
                  ShowingEditor="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