System.ArgumentException: 'An item with the same key has already been added.' when the data source contains DateTime with the same hour, minute, and seconds part (only milliseconds are different):
The following line gets serialized when set this property:
((Telerik.WinControls.UI.GridSelectCheckBoxElement)(this.radGridView1.GetChildAt(0).GetChildAt(0).GetChildAt(2).GetChildAt(0).GetChildAt(0).GetChildAt(1).GetChildAt(0).GetChildAt(1).GetChildAt(0))).Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
Call stack:
Telerik.WinControls.GridView.dll!Telerik.WinControls.UI.GridGroupHeaderRowElement.Initialize(Telerik.WinControls.UI.GridViewRowInfo rowInfo) Line 100 at Telerik.WinControls.UI\GridGroupHeaderRowElement.cs(100) Telerik.WinControls.GridView.dll!Telerik.WinControls.Export.GridExportUtils.GetRowHeight(Telerik.WinControls.UI.RadGridView radGridView, Telerik.WinControls.UI.RowElementProvider rowProvider, Telerik.WinControls.UI.CellElementProvider cellProvider, Telerik.WinControls.UI.GridViewRowInfo gridViewRowInfo, bool exportVisualSettings) Line 158 at Telerik.WinControls.Export\GridExportUtils.cs(158) Telerik.WinControls.GridView.dll!Telerik.WinControls.Export.GridViewSpreadExport.AddRow(Telerik.WinControls.UI.GridViewRowInfo gridViewRowInfo, int rowIndex) Line 960
maskBoxColumn.FormatInfo = CultureInfo.CreateSpecificCulture("en-AE");
In this scenario, the RadGridView.DataSource property is set to Microsoft.EntityFrameworkCore.ChangeTracking.ObservableCollectionListSource. When the RadGridView.Rows.Remove() method is called an IndexOutOfRange exception is thrown.