I have a datagridview that has about 3500 records. This actually represents only a small portion of the total number of records that will be in this control when the application is rolled out.
The data is bound to many different controls in the aplication, but only a few with the ability to be edited. The datagridview itself is readonly, the only changes to the data are through the various controls.
The problem is that whenever a user might use the arrow keys to navigate the datagridview, an exception is thrown. Remember that while the user is changing records with the up or down arrow, no records are being edited.
If the selected row is only changed at the rate of about 1 per second, there is no exception. Since I can't edit the datagridview to deal with the exception, how might I resolve this?
The data is bound to many different controls in the aplication, but only a few with the ability to be edited. The datagridview itself is readonly, the only changes to the data are through the various controls.
The problem is that whenever a user might use the arrow keys to navigate the datagridview, an exception is thrown. Remember that while the user is changing records with the up or down arrow, no records are being edited.
System.InvalidOperationException: Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.
at System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
at System.Windows.Forms.DataGridView.ProcessDownKeyInternal(Keys keyData, Boolean& moved)
at System.Windows.Forms.DataGridView.ProcessDataGridViewKey(KeyEventArgs e)
at System.Windows.Forms.DataGridView.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.DataGridView.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.DataGridView.WndProc(Message& m)
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)
If the selected row is only changed at the rate of about 1 per second, there is no exception. Since I can't edit the datagridview to deal with the exception, how might I resolve this?