Steps to reproduce:
1. Bind the grid and enable the search row
2. Enter some search text
3. Delete records from the applied DataSource collection. It may be necessary to perform the delete operation several times before the error occurs.
The error can be reproduced with the following code snippet:
Dim dt As New DataTable
Sub New()
InitializeComponent()
dt.Columns.Add("Id", GetType(Integer))
dt.Columns.Add("Name", GetType(String))
For index = 1 To 10000
dt.Rows.Add(index, Guid.NewGuid.ToString())
Next
Me.RadGridView1.DataSource = dt
Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
Me.RadGridView1.AllowSearchRow = True
End Sub
Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
For index = 1 To 50
dt.Rows.RemoveAt(0)
Next
End Sub
There is a sample project attached as well and its result is illustrated in the gif file.
Stack trace:
at Telerik.WinControls.UI.MasterGridViewTemplate.set_CurrentRow(GridViewRowInfo value) at Telerik.WinControls.UI.RadGridView.set_CurrentRow(GridViewRowInfo value) at Telerik.WinControls.UI.GridViewSearchRowInfo.SetCurrent(GridSearchResultCellInfo cell) at Telerik.WinControls.UI.GridViewSearchRowInfo.SetCurrent(GridSearchResultCellInfo cell, Boolean checkInvokeRequired) at Telerik.WinControls.UI.GridViewSearchRowInfo.SelectNextSearchResult() at Telerik.WinControls.UI.GridViewSearchRowInfo.Search(String criteria) at Telerik.WinControls.UI.GridViewSearchRowInfo.Telerik.WinControls.UI.IGridViewEventListener.PostProcessEvent(GridViewEvent eventData) at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode) at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent) at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents() at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent) at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI) at Telerik.WinControls.UI.GridViewRowCollection.DispatchDataViewChangedEvent(DataViewChangedEventArgs args, GridEventType type) at Telerik.WinControls.UI.GridViewRowCollection.ListSource_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at Telerik.WinControls.Data.RadListSource`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Telerik.WinControls.Data.RadListSource`1.RemoveItem(Int32 index) at Telerik.WinControls.Data.RadListSource`1.currencyManager_ListChanged(Object sender, ListChangedEventArgs e) at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e) at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e) at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e) at System.Windows.Forms.BindingSource.InnerList_ListChanged(Object sender, ListChangedEventArgs e) at System.ComponentModel.BindingList`1.OnListChanged(ListChangedEventArgs e) at System.ComponentModel.BindingList`1.FireListChanged(ListChangedType type, Int32 index) at System.ComponentModel.BindingList`1.RemoveItem(Int32 index) at System.Collections.ObjectModel.Collection`1.Remove(T item) at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Remove(Object value) at System.Windows.Forms.BindingSource.Remove(Object value)