maui-devexpress-dot-maui-dot-datagrid-dot-datagridview-6ca21ca8.md
Gets or sets the appearance settings that are applied to the current DataGridView‘s swipe items. This is a bindable property.
Namespace : DevExpress.Maui.DataGrid
Assembly : DevExpress.Maui.DataGrid.dll
NuGet Package : DevExpress.Maui.DataGrid
public SwipeItemAppearance SwipeItemAppearance { get; set; }
| Type | Description |
|---|---|
| SwipeItemAppearance |
The appearance settings.
|
Refer to the following topic to see the available appearance properties: SwipeItemAppearance members.
The SwipeItemAppearance class properties customize the following appearance parameters of a swipe item:
Settings that the SwipeItemAppearance object contains are applied to all swipe items of the grid. To customize the width and colors of an individual swipe item, use the GridSwipeItem object’s Width and BackgroundColor/FontColor properties.
This example shows how to define the following swipe actions for rows of a data grid bound to a collection of orders:
Add a Customer swipe item to the DataGridView.StartSwipeItems collection, and a Delete swipe item to DataGridView.EndSwipeItems.
Specify a background color and image for each swipe item.
Add image files (.svg) to the project and set their Build Action property to MauiImage.
Handle the GridSwipeItem.Tap event to assign custom actions to swipe buttons.
Use the DataGridView.SwipeItemAppearance property to set the same width for both swipe buttons.
<dxg:DataGridView x:Name="grid" ItemsSource="{Binding Orders}">
<!-- ... -->
<dxg:DataGridView.StartSwipeItems>
<dxg:GridSwipeItem Caption="Customer" BackgroundColor="#797bff" Image="name.svg"
Tap="Swipe_ShowCustomerInfo" />
</dxg:DataGridView.StartSwipeItems>
<dxg:DataGridView.EndSwipeItems>
<dxg:GridSwipeItem Caption="Delete" BackgroundColor="#ff3b30" Image="delete.svg"
Tap="Swipe_Delete"/>
</dxg:DataGridView.EndSwipeItems>
<dxg:DataGridView.SwipeItemAppearance>
<dxg:SwipeItemAppearance Width="100"/>
</dxg:DataGridView.SwipeItemAppearance>
</dxg:DataGridView>
using Microsoft.Maui.Controls;
using DevExpress.Maui.DataGrid;
// ...
private void Swipe_ShowCustomerInfo(object sender, SwipeItemTapEventArgs e) {
var customer = (e.Item as Order).Customer;
string customerName = customer.Name;
string customerPhone = customer.Phone;
DisplayAlert("Customer", "Name: " + customerName + "\n" + "Phone: " + customerPhone, "OK");
}
private void Swipe_Delete(object sender, SwipeItemTapEventArgs e) {
grid.DeleteRow(e.RowHandle);
}
View Example: Define Swipe Actions for Data Rows
See Also