The requested page is not available for the requested platform. You are viewing the content for Default platform.

SwipeButtonEventArgs Class

Provides data for the GridControl.SwipeButtonClick event.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.2.dll

Declaration

public class SwipeButtonEventArgs :
    SourceRowEventArgs
Public Class SwipeButtonEventArgs
    Inherits SourceRowEventArgs

Remarks

Important

This documentation topic describes legacy technology. We no longer develop new functionality for the GridControl and suggest that you use the new DataGridView control instead.

The GridControl.SwipeButtonClick event is raised when an end-user taps a swipe button in the grid. You can handle this event to define an action to be performed when a button is tapped. The SwipeButtonEventArgs.ButtonInfo property allows you to obtain information on the currently processed button. The RowHandle parameter returns a row handle for which a swipe button is shown.

The SwipeButtonEventArgs objects are automatically created, initialized and passed to the GridControl.SwipeButtonClick event handlers.

Examples

This example shows how to extend the grid’s UI with additional buttons to be shown when an end-user swipes left to right, or right to left, over a data row – Swipe Buttons. To create a swipe button, add a SwipeButtonInfo object to the GridControl.LeftSwipeButtons or GridControl.RightSwipeButtons collection. Use this object's SwipeButtonInfo.Caption, SwipeButtonInfo.Width, SwipeButtonInfo.BackgroundColor and SwipeButtonInfo.TextColor properties to specify button appearance.

To assign a custom action to a button, handle the GridControl.SwipeButtonClick event. The GridControl.SwipeButtonShowing event allows you to specify when a swipe button should be visible.

In the example, two swipe buttons are created.

  • When an end-user swipes any data row left to right, the Day button is shown on the left side of the row. Tapping this button displays the day of the week when the corresponding order was made.

    GridControl_LeftSwipeButton

  • When an end-user swipes right to left, a data row which corresponds to an order that is already shipped (the value in the Shipped column is true), the Delete button is shown on the right side of the row. Tapping this button removes the corresponding data row.

    GridControl_RightSwipeButton

<dxGrid:GridControl.LeftSwipeButtons>
  <dxGrid:SwipeButtonInfo ButtonName="LeftButton" Caption="Day" BackgroundColor="Green" Width="150"/>
</dxGrid:GridControl.LeftSwipeButtons>

<dxGrid:GridControl.RightSwipeButtons>
  <dxGrid:SwipeButtonInfo ButtonName="RightButton" Caption="Delete" BackgroundColor="Red" Width="150"/>
</dxGrid:GridControl.RightSwipeButtons>
See Also