From 001f75c4cd6ac9a4823c84d37fb842a01fa5f018 Mon Sep 17 00:00:00 2001 From: NLNet Date: Wed, 13 Sep 2023 16:47:46 +0800 Subject: [PATCH] Fix DataGrid' SelectedItems removing wrong item when DataGrid is grouping (#12874) --- .../DataGridSelectedItemsCollection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls.DataGrid/DataGridSelectedItemsCollection.cs b/src/Avalonia.Controls.DataGrid/DataGridSelectedItemsCollection.cs index eafee530c5..7a0dd24318 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridSelectedItemsCollection.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridSelectedItemsCollection.cs @@ -155,7 +155,7 @@ namespace Avalonia.Controls return; } - OwningGrid.SetRowSelection(itemIndex, false /*isSelected*/, false /*setAnchorSlot*/); + OwningGrid.SetRowSelection(OwningGrid.SlotFromRowIndex(itemIndex), false /*isSelected*/, false /*setAnchorSlot*/); } public void RemoveAt(int index)