Error on Filter

Hi,


I am using sfdatagrid and have thread mechanism implemented in the form. When I click on filter icon in the columnheader, sometimes I get the below specified error. Not always. Please help


System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)

at System.Collections.Generic.List`1.Enumerator.MoveNextRare()

at System.Collections.Generic.List`1.Enumerator.MoveNext()

at Syncfusion.WinForms.DataGrid.GridFiltering.DataGridFilterControl.ResetDataSource()

at Syncfusion.WinForms.DataGrid.GridFiltering.DataGridFilterControl.OnSearchTextBoxTextChanged(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnTextChanged(EventArgs e)

at Syncfusion.Windows.Forms.Tools.TextBoxExt.OnTextChanged(EventArgs e)

at System.Windows.Forms.Control.set_Text(String value)

at System.Windows.Forms.TextBoxBase.set_Text(String value)

at System.Windows.Forms.TextBox.set_Text(String value)

at Syncfusion.WinForms.GridCommon.FilterControlBase.OnFilterPopupOpening(Object sender, CancelEventArgs e)

at Syncfusion.WinForms.DataGrid.GridFiltering.DataGridFilterControl.OnFilterPopupOpening(Object sender, CancelEventArgs e)

at System.Windows.Forms.ToolStripDropDown.OnOpening(CancelEventArgs e)

at Syncfusion.WinForms.GridCommon.FilterPopupBase.OnOpening(CancelEventArgs e)

at System.Windows.Forms.ToolStripDropDown.SetVisibleCore(Boolean visible)

at System.Windows.Forms.ToolStripDropDown.Show(Control control, Point position)

at Syncfusion.WinForms.GridCommon.FilterControlBase.Show(Control control, Point location)

at Syncfusion.WinForms.DataGrid.GridFiltering.DataGridFilterControl.Show(Control control, Point location)

at Syncfusion.WinForms.DataGrid.GridHandler.ShowFilterPopup(GridColumn column, Point location)

at Syncfusion.WinForms.DataGrid.GridHandler.OnMouseClick(Object sender, MouseEventArgs e)

at System.Windows.Forms.Control.OnMouseClick(MouseEventArgs e)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at Syncfusion.WinForms.Controls.SfScrollControl.WndProc(Message& msg)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Thanks,

Sreedevi


1 Reply

MA Mohanram Anbukkarasu Syncfusion Team July 8, 2021 02:14 PM UTC

Hi Sreedevi,  

Thanks for contacting Syncfusion support. 

We regret to let you know that as you have mentioned that the reported issue doesn’t occurs always, we are unable to reproduce the issue in our end only with the provided stack trace. Could you please share the below requested details.  

  1. Code snippet related to SfDataGrid in your application.
  2. Details about the thread related code and the reason to use that in your application.
  3. Syncfusion product version you are using.
Kindly revert to us with all the above requested details. It will be more helpful for us to find the exact cause for the issue and to provide a prompt solution.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon