Skip to content

[Hotfix] Code changes regarding swiping Ug correction. #3202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: hotfix/hotfix-v29.1.33
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions MAUI/DataGrid/swiping.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,21 +293,22 @@ Operations such as deleting a row by swiping a data row from one extent to anoth

public partial class MainPage : ContentPage
{
private int swipedRowIndex;
public MainPage()
{
InitializeComponent();
}

private void dataGrid_SwipeEnded(object sender, Syncfusion.Maui.DataGrid.DataGridSwipeEndedEventArgs e)
{
swipedRowIndex = e.RowIndex;
doDeleting();
PerformRowDelete(e.RowData);
}

private void doDeleting()
private void PerformRowDelete(object? rowData)
{
viewModel.OrdersInfo.RemoveAt(swipedRowIndex - 1);
if (rowData is OrdersInfo orderInfo && viewModel.OrdersInfo.Contains(orderInfo))
{
viewModel.OrdersInfo.Remove(orderInfo);
}
}
}
{% endhighlight %}
Expand Down