DataGridView.SwipeItemShowing Event
Fires when a swipe item is about to be shown when a user swipes a row from left to right or from right to left, and allows you to cancel the action.
Namespace: DevExpress.XamarinForms.DataGrid
Assembly: DevExpress.XamarinForms.Grid.dll
NuGet Package: DevExpress.XamarinForms.Grid
Declaration
public event SwipeItemEventHandler SwipeItemShowing
Event Data
The SwipeItemShowing event's data class is SwipeItemEventArgs. 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. |
IsStartSwipeItem | Gets whether the processed swipe item is about to be displayed on the left side of a grid row. |
Item | Gets the data item that corresponds to the processed grid row. |
RowHandle | Gets the processed row’s handle. |
SwipeItem | Gets the swipe item that is about to be shown. |
Example
In the markup below, the right-side swipe item is Reply. The code below shows how to prevent this item from showing if the sender’s email contains “donotreply”.
<dxg:DataGridView x:Name="grid" ItemsSource="{Binding OutlookData}" SwipeItemShowing="grid_SwipeItemShowing">
<dxg:DataGridView.StartSwipeItems>
<dxg:SwipeItem Caption="Sender Info" BackgroundColor="#26a95e" Tap="OnShowCustomerInfo" />
</dxg:DataGridView.StartSwipeItems>
<dxg:DataGridView.EndSwipeItems>
<dxg:SwipeItem Caption="Reply" BackgroundColor="#797bff" Tap="OnReply" />
</dxg:DataGridView.EndSwipeItems>
<dxg:DataGridView.Columns>
<dxg:TextColumn FieldName="From.Email" Caption="From" Width="150">
<dxg:TextColumn.Width>
<OnIdiom x:TypeArguments="GridLength" Phone="110" Tablet="150"/>
</dxg:TextColumn.Width>
</dxg:TextColumn>
<dxg:TextColumn FieldName="Subject" />
<dxg:DateColumn FieldName="Sent" Width="150">
<dxg:DateColumn.IsVisible>
<OnIdiom x:TypeArguments="x:Boolean" Phone="false" Tablet="true"/>
</dxg:DateColumn.IsVisible>
</dxg:DateColumn>
</dxg:DataGridView.Columns>
</dxg:DataGridView>
See Also